Using a Domain Management Doctrine

I’m thinking about introducing a domain-driven approach (similar to the one described here ), but I want to integrate it with the ORM Doctrine. Has anyone had success doing something like this?

My initial instinct was to use Doctrine as a DAO layer, but for Doctrine it seems a bit confusing to display the fields of my database, and the objects of the object object are mapped (essentially) to the same set of fields of the Doctrine object.

My initial goal was to separate all my DQL / query logic from my Entities domain, but now I feel a little lost in the field of design.

I know that Doctrine 2 should provide a much friendlier approach to DDD methods, but I'm not sure I want to wait so long. Does what I want to do make sense, or should I find a different approach?

Thanks.

+3
source share
1 answer

The doctrine, in my opinion, is not perfect for DDD due to the lack of a Repository class . Doctrine supports templates such as Table Data Gateway and Active Record, which, although good templates for certain problems, are not always the best choice for a “classic” DDD. However, you can get around these shortcomings.

, Doctrine_Table . , "BlogPost", "BlogPostTable", Doctrine_Table. , "findByCategory" BlogPostTable, ​​ ( Doctrine_Record). , , "" DDD, .

DDD. - Ubiquitous Language, , .

+2

Source: https://habr.com/ru/post/1715455/


All Articles