1

Topic: What are the advantages of using Doctrine?

Hi All,

I am 3-4 days old to zend framework I am looking various article and various tutorial and try to learn the zend framework.

Just wanted to get more info on zend frame want to ask few question on using the doctrine.

My Questions are,

1) I have seen online tutorial, and most of the place i found examples where user has used ZEND_DB_TABLE api with insert, update delete, or custom query. Since zend_db_table api is zend inbuild component it will work fast rather than if we use third part layer like doctrine or propel. Please let me know if i am wrong here.

2) If we want to use the doctrine then we need to do additional configuration and learn doctrine

3) Here i am not sure how cache with work with doctrine
  i.e.  1) Not sure if doctrine do the query catch or sql output cache in file or memory. If yes then how zend cache will manage it i.e. delete , update or add.
       2) If doctrine doing the cache then should we use doctrine method for caching?
      3) If we use zend_db_table api's with zend cache, isn't its fast and better?


Please let me know on above points.

Regards,
Ash

Last edited by ashinaidu (2010-07-15 04:40:01)

2

Re: What are the advantages of using Doctrine?

Hi.

I don't know whether Doctrine is usefull if you are not familiar with the Zend Framework already. I used Zend_Db for a long time, but thinking about switching to Doctrine for the following reasons:

- Doctrine is some kind of 'standard'. You could take this knowledge from project to project, no matter what MVC-Framework you are using. Moreover, you could hire a Doctrine Developer if you need somebody to create your DB.

- I like the idea of creating the database with scripts. This is usefull for example in a unit testing process, where you may want to create a temporary test-database.
This is possible with Zend_Db and some odd PHP, but its easier the Doctrine Way.

- I've heard of a seamless integration into Zend Framework 2.0. If Zend Framework goes for Doctrine anyways, why should I deny it nowadays ?

- Doctrine has (as far as I know) a huge collection of DB-Adapters (DBAL). These can port your project from a MySQL to a different Adapter in an easy way. This is supported by Zend_Db too, but there are less adapters.

These are my thoughts for going Doctrine, you would better ask in a Doctrine Forum about the advantages of Doctrine.

Using Doctrine instead of Zend_Db should not harm your speed in a relevant way, because Zend_Db is not used in this configuration anymore. It's replacing Zend_Db, as far as I understand the concept.

Manuel

Last edited by Manuel (2010-07-23 18:10:10)