What are the differences between Doctrine1 and Doctrine2?
I have only started discovering Doctrine and noticed the official documentation points to 1.2 as this seems to be the current stable version.
I also noticed that a lot of people seem to mention Doctrine 2 is a "world of difference" compared to Doctrine 1, but when looking at the What's new page, I don't really see an extensive changelog. I am guessing this list only shows the newest additions compared to the previous 2.x build. I expected to find a nice roundup of differences after Googling this same question, but I can not seem it.
I am currently plowing through the Doctrine 1 manual, and will do the same for Doctrine 2 as soon as I finish reading it, but a proper overview of the big changes would be really appreciated, so my question is:
What are the differences between Doctrine1 and 开发者_如何学JAVADoctrine2?
Well... Doctrine1 and Doctrine2 are totally incomparable as they realize completely different approaches.
- Doctrine1 implements ActiveRecord design while D2 implements DataMapper design - that's the most important difference.
- D2 requires PHP 5.3 or newer and uses its benefits like namespaces.
- D2 is divided into set of smaller subprojects: Doctrine Commons, Doctrine DBAL, Doctrine ORM (for RDBMS) and Doctrine ODM (for MongoDB).
- D2 is much faster.
- D2 supports annotations.
Although D2 isn't still stable it's the future so don't waste time for learning D1.
Take a look at this presentation (and maybe some of the related others), really nice!
精彩评论