ddd-service

DDD: is it ok to inject a Service into an Entity

吃可爱长大的小学妹 提交于 2020-01-13 03:20:08
问题 I have a tree of Zone objects: class Zone { protected $parent; public function __construct(Zone $parent) { $this->parent = $parent; } } There are no children nor descendants property in the Zone, because I want to avoid the pain of managing these relationships in the domain model. Instead, a domain service maintains a closure table in the database, to map a zone to all its descendants, at any level. Now, I have a User which can be assigned one or more Zones: class User { protected $zones;

which architecture is good for implementing in this project? [closed]

﹥>﹥吖頭↗ 提交于 2019-12-27 02:09:08
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . i am new in architecture .I have a MVC web application project and I want to use EF code FIRST .I want to use an architecture for this project.I want to use DDD(domain driven design) but it is for large project. i want a simple of DDD that support this things in my project: 1-repository pattern 2-IOC 3-service

DDD design understanding

纵然是瞬间 提交于 2019-12-06 09:55:18
问题 I've been starting to learn about DDD and I have couple of questions so that I can improve my understanding of it. So a typical DDD architecture looks like this Domain Layer => this layer should be technology agnostic and should contain the following Domain.Entities (different from the persistence layer Entities, should contain only validation rules ? any other domain business should go here?) Domain.ValueObjects (objects that do not require to be unique in the domain, should contain only

DDD: where should logic go that tests the existence of an entity?

时间秒杀一切 提交于 2019-12-06 05:35:27
问题 I am in the process of refactoring an application and am trying to figure out where certain logic should fit. For example, during the registration process I have to check if a user exists based upon their email address. As this requires testing if the user exists in the database it seems as if this logic should not be tied to the model as its existence is dictated by it being in the database. However, I will have a method on the repository responsible for fetching the user by email, etc. This

DDD design understanding

╄→尐↘猪︶ㄣ 提交于 2019-12-04 17:00:59
I've been starting to learn about DDD and I have couple of questions so that I can improve my understanding of it. So a typical DDD architecture looks like this Domain Layer => this layer should be technology agnostic and should contain the following Domain.Entities (different from the persistence layer Entities, should contain only validation rules ? any other domain business should go here?) Domain.ValueObjects (objects that do not require to be unique in the domain, should contain only validation rules) Domain.Services (this layer should contain business logic that although related to an

DDD: where should logic go that tests the existence of an entity?

旧街凉风 提交于 2019-12-04 10:42:56
I am in the process of refactoring an application and am trying to figure out where certain logic should fit. For example, during the registration process I have to check if a user exists based upon their email address. As this requires testing if the user exists in the database it seems as if this logic should not be tied to the model as its existence is dictated by it being in the database. However, I will have a method on the repository responsible for fetching the user by email, etc. This handles the part about retrieval of the user if they exist. From a use case perspective, registration

DDD: is it ok to inject a Service into an Entity

瘦欲@ 提交于 2019-12-04 09:38:41
I have a tree of Zone objects: class Zone { protected $parent; public function __construct(Zone $parent) { $this->parent = $parent; } } There are no children nor descendants property in the Zone, because I want to avoid the pain of managing these relationships in the domain model. Instead, a domain service maintains a closure table in the database, to map a zone to all its descendants, at any level. Now, I have a User which can be assigned one or more Zones: class User { protected $zones; public function assignZone(Zone $zone) { $this->zones[] = $zone; } } My problem is that, prior to