in Back to PHP

My Way to PHP: Day 28 of 75

Doctrine

The talk starts off with different design patterns used with databases.

Gateways which are just a thin abstraction. It covers the CRUD operations and that’s it.

Active Record (e.g. Doctrine 1.x)

An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data.

Mapping and repository is also included. It can persist itself therefore the name active.

Data Mapper (e.g. Doctrine 2.x)

A layer of Mappers that moves data between objects and a database while keeping them independent of each other and the mapper itself.

  • Simple Models
  • Manager handles persistence
  • Repository takes care of queries

 

  • ObjectManager
  • find, persist, remove, flush
  • ObjectRepository
  • find, findAll, findBy, findOneBy

That was a great talk! Doctrine was one of the things I found hard to get. But the talk gives a good background which helps to understand the idea behind it.


How I Accidentally Wrote the Best Code of my Career

There’s a great story about using metaphors at the beginning in this talk. He also says that talking out loud helped him. I wrote about that before and it seem to work quite well.

Tell a story about your code and make it a social problem because people know how to solve it already.

Good talk!


The Clean Code Talks – Unit Testing

I like this observation. With scenario / integration tests you have a high confidence that the scenario works that you tested. But if it doesn’t work then you’re in trouble.


Updates Goals:

  • Learn Symfony2
  • Learn a bit more about MySQL
  • Write at least one web app using Symfony2 and its core components (templating, testing, forms, validation, security)
  • Watch one video per day on average

Progress status

In Progress

  • Watch one video per day on average [60 of 75]

Write a Comment

Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.