开发者

Domain-driven design with Zend

开发者 https://www.devze.com 2022-12-25 13:59 出处:网络
This question is a continuation of my previous question here zend models architecture (big thanks to Bill Karwin).

This question is a continuation of my previous question here zend models architecture (big thanks to Bill Karwin). I've made some reading including this article

  • http://weierophinney.net/matthew/archives/202-Model-Infrastructure.html

and this question

  • How To Properly Create Domain using Zend Framework?

Now I understand, what domain driven design is. But examples are still very simple and poor. They are based on one table and one model. Now, my question is: do they 开发者_如何转开发use Domain Model Design in real-world PHP projects?

I've been looking for some good documentation about this, but I haven't found anything good enough, that explains how to manage several tables and transfer them to Domain Objects. As long as I know, there is Hibernate library, that has this features in Java, but what should I use in PHP (Zend Framework)?


There is a newsgroup formed by Matthias Verraes about doing DDD in PHP, mainly with Sf2.

Somewhat older is a series of articles by Federico Cargnelutti on how to do DDD with PHP and in parts with ZF that might be of interest to you:

  • Domain-Driven Design and MVC Architectures
  • Domain-Driven Design: Data Access Strategies
  • Domain-Driven Design: The Repository
  • Domain-Driven Design: Sample Application

Regarding ZF, there has been a proposal for Zend_Entity and Zend_DataMapper for some time, but development on those has been terminated in favor of integrating ZF with Doctrine. Doctrine is also the closest thing to Hibernate in PHP.

When googling for DDD with PHP, there will be a few additional resources, but nothing as comprehensive as the resources available at the official DDD site with code for the App described in Eric Evan's DDD book.


Have a look at my project at GitHub. It tried to follow the principles of DDD, SOLID and OOP. PHP and DDD. There is no ORM inside but a hand-made Data Access Layer. Domain entities exchange messages. Presentation Layer gets a special kind of objects. You will find a lot of factories. They are intended to simplify unit testing and maintenace. I hope some techniques can be of interest for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消