M
M
Mozart2011-03-28 00:37:43
PHP
Mozart, 2011-03-28 00:37:43

domain model

I read about this pattern of Fowler and Zandstru + browsed the Internet. The problem is that there are quite a few complete examples of implementation, or I did not see it due to the mess in my head. Maybe someone has or someone will tell you how to fully apply this pattern. Take at least a simple example (news + news categories) in conjunction with any popular framework (ci, kohana 3.0-3.1, yii or zend). It is clear that this is too simple an example for this pattern, but I think they can visually depict the application. As I understand it, it should be something like this
1) Business logic - domain-model
2) Data source - Data mapper
3) Service layer - binding
Such an implementation as far as I understand in livestreet. And what class hierarchy should be applied to the framework and where to see how it is correctly and beautifully implemented.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zizop, 2011-03-28
@zizop

According to Fowler, you need to capture the behavior and properties of the system. There are three options:

  • Simple - these are model classes (ActiveRecord / Zend_Db / Doctrine_Record) that encapsulate behavior within themselves.
  • Complex - models encapsulate data and access methods to them (Doctrine_Record) and the basic behavior of ONE instance of the model, and complex (group, business logic operations) operations are implemented in the service layer (p. 143 of the book Architecture of Enterprise Software Solutions).
  • The most difficult one is that almost all business logic goes into services, which become a distinct API for interacting with the subject area.

As an implementation, you can look at Doctrine_Record + Zend_Controller + self-written service classes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question