Difference between ActiveRecord & Data Access Objects


What is the major difference between ActiveRecord and Data Access Objects and both seems to inherit the same base classes .

In my case I want to use PDO for my application and can anyone tell the pros and cons of using ActiveRecord and DAO.

Check this post: http://www.yiiframework.com/forum/index.php?/topic/3830-activerecord-vs-dao-peformance/


You can and usually will use both. Using Yii AR is fast, easy, if you are using gii, you will see that gii generated code are using AR extensively. AR are very easy to use.

DAO on other side, can be only option for some complex queries, and/or where performance is important.

You can use them both in same application.