简体   繁体   中英

Starting with Doctrine. Which version is good to?

I'm using Zend Framework and I feel that I need a good ORM to work with. I don't know much of Zend Framework, I just know how to do the basics. I expect to work together with both Doctrine and Zend Framework

But to sget started, I'm going to try a simple Doctrine project (no ZF) to get used to the application. Then I'll try to integrate it in ZF

Which version of Doctrine do I start learning? Does Doctrine have a good integration with ZF?

Besides, Is there any recent site for Doctrine learning? I just can't find the sandbox version to follow the Doctrine documentation. If anyone knows of any tutorial on how to get started with doctrine only first, please let me know

I've done projects with zend framework and doctrine. They play pretty nice together.

I followed this tutorial and it worked well.

But honestly I don't use doctrine on anything but the largest sites. I've switched over to RedBean . Zero configuration autodiscovery, and the ability to freeze data models when you are done for maximum performance.

You should really try it out, it is so simple its stupid. It is really one of the best ORM's ive ever used. EVER. Try it.

I am personally using Doctrine 1.2

and i followed the Zendcasts.com "more than 5 casts about doctrine" & same Byron's tuts

both of them is good

Update : 1- http://www.zendcasts.com/deep-integration-between-zend-and-doctrine-1-2/2010/01/ has the sample code

2- http://www.doctrine-project.org/projects/orm/1.2/download/1.2.3 has the doctrine framework if you need to download it alone

I've found Doctrine2 reasonable stable, although it's still in beta. It seems most of the other PHP 'ORM' libraries (Doctrine 1.2 included) are Active Record, while Doctrine2 is a Data Mapper. In my opinion, you can put together a relatively simple Active Record using Zend's native Db_Table , so that makes Doctrine 1.2 less appealing (at least to me).

I've used this answer about integrating Doctrine2 and Zend Framework .

I agree with Byron , and have only used Doctrine2 on select projects.

[As an aside, I've noticed RedBean in the past, and have wanted to try it - from what I've seen it's certainly worth taking a look.]

Doctrine 2 is in beta and requires PHP5.3 as it fully utilizes Namespaces. If you cannot use PHP5.3 in your project, you cannot use Doctrine 2.

Apart from that, there has been a number of architectural changes in Doctrine 2 that make it much more attractive than Doctrine < 2, mainly

  • using DataMapper instead of ActiveRecord
  • promotes DI over static calls
  • faster and less memory-intensive
  • revolves around Entities and DDD
  • uses "Annotations"

See

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM