A free and open-source book on Zend Framework for beginners


4.21. Determining the Correct Model Type

Isn't it confusing to have so many model types?

Well, yes and no. At first, it may be a little difficult to determine the correct model type, but as soon you improve your skills, you will be able to do that intuitively. Just remember that model types improve the structure of your domain models.

When writing your own application, you may be confused when trying to decide to which model type your class belongs (whether it is an entity, value object, repository, service or factory). Below, a simple algorithm is provided to make it easier for you to determine the correct model type when writing your own application:

Hmm... what if I just store all my models in a single Model directory?

Of course, you can, if you strongly wish. But, when you use Doctrine ORM library, you will notice that it utilizes DDD principles as well, so using DDD makes your application well-organized.


Top