Implement DTO & Service Layer concept in Yii


We are developing a very large application, 100s of Active record models & many controllers. Integration of java api & many public api’s.

From the point of MVC pattern we have done well but we want to keep our code clean, its getting messy as features are increasing in application. We would like to implement Java like DTO’s & Service layer architecture.

What we want:

Every interaction between a controller & a model should happen through Service layer & a model always will return a DTO instance.

Their will be a search class for every model through we will generate CDbCriteria & search data from the table.

Search class instance will be send from controller to service layer, service layer will a model & return the result as DTO instance.

If any body have done this kind implementation in their application, please let us know.