domain-driven-design

Programming pattern / architectural question

旧时模样 提交于 2019-12-21 02:37:08
问题 I am currently working on a project where I have a BankAccount entity for some other entity. Each bank account as a reference to a bank entity, an account number and optionally an IBAN. Now since an IBAN can be validated, how can I ensure that when the IBAN is set for an account is valid. What would be a clean architectural approach? I currently have a domain layer without any reference to any other layer and I like this clean approach (I was inspired by Eric Evans DDD). Fortunately the IBAN

Domain driven design repository implementation in infrastructure layer

China☆狼群 提交于 2019-12-20 12:37:14
问题 I got a question on dependencies of DDD layered architecture. If the Repository implementation is in the infrastructure layer, that means that infrastructure layer has a dependency on domain layer because Entities will be referenced in the Repository implementation. On the other side, the Domain layer can have references to the infrastructure layer if infrastructure services are used in the domain. Wouldn't this create a cyclic reference? 回答1: Look at the onion architecture it shows a good

Looking for examples of Domain Events

ε祈祈猫儿з 提交于 2019-12-20 12:36:09
问题 Does any one know where to find example code for an implementation of Domain Events as described by Udi Dahan in Domain Events – Salvation? 回答1: DDDSample.Net has one. 回答2: A better implementation of Domain Events, in my opinion, can be found at https://github.com/bsommardahl/BlingBag. There's a sample application and implementation instructions. I like this implementation more because it doesn't use the static class to raise domain events and doesn't couple your domain to your infrastructure

DDD Projects Structure With WCF

血红的双手。 提交于 2019-12-20 10:54:17
问题 I'm starting a new WCF-based project which is composed by an "Engine" and some desktop applications. But i found it difficult to make my project structure. Engine (Windows Service, which host WCF Services for Desktop applications access and host all my business logic) Desktop Application (Only Presentation) Shared MyProject.Core (Customers/Customer, Customers/ICustomerService) Engine MyProject.Engine (Customers/CustomerService, Customers/ICustomer, Customers/ICustomerRepository) MyProject

DDD User Security Policies

泪湿孤枕 提交于 2019-12-20 10:46:35
问题 I have a RentalProperty class which looks something like this: class RentalProperty { Money MonthlyRent; List<MaintainenceCall> MaintainenceCalls; } From my understanding, using DDD to change the MonthlyRent, I would get the RentalProperty, change the MonthlyRent property, and call RentalPropertyRepository.Save(). The same process would be handled to add a new MaintainenceCall. The problem I have is that, for example, a Handyman should be able to add a MaintainenceCall, but should not be

How can I resolve the conflict between loose coupling/dependency injection and a rich domain model?

馋奶兔 提交于 2019-12-20 10:44:20
问题 Edit: This is not a conflict on the theoretical level but a conflict on an implementation level. Another Edit: The problem is not having domain models as data-only/DTOs versus richer, more complex object map where Order has OrderItems and some calculateTotal logic. The specific problem is when, for example, that Order needs to grab the latest wholesale prices of the OrderItem from some web service in China (for example). So you have some Spring Service running that allows calls to this

In DDD, who should be resposible for handling domain events?

可紊 提交于 2019-12-20 10:43:55
问题 Who should be responsible for handling domain events? Application services, domain services or entities itself? Let's use simple example for this question. Let's say we work on shop application, and we have an application service dedicated to order operations. In this application Order is an aggregate root and following rules, we can work only with one aggregate within single transaction. After Order is placed, it is persisted in a database. But there is more to be done. First of all, we need

DDD - How to design associations between different bounded contexts

牧云@^-^@ 提交于 2019-12-20 10:08:42
问题 I have setup a domain project which is being populated with an ORM. The domain contains of different aggregates each with its own root object. My question is how properties that cross the aggregate boundries should be treated? Should these properties simply ignore the boundries so that a domain object in bounded context A has a reference to an object in context B? Or, should there be no direct link from context A to B and does the object in context A have an "int ContextBId" property that can

DDD - How to design associations between different bounded contexts

∥☆過路亽.° 提交于 2019-12-20 10:07:17
问题 I have setup a domain project which is being populated with an ORM. The domain contains of different aggregates each with its own root object. My question is how properties that cross the aggregate boundries should be treated? Should these properties simply ignore the boundries so that a domain object in bounded context A has a reference to an object in context B? Or, should there be no direct link from context A to B and does the object in context A have an "int ContextBId" property that can

App-level settings in DDD?

偶尔善良 提交于 2019-12-20 09:56:52
问题 Just wanted to get the groups thoughts on how to handle configuration details of entities. What I'm thinking of specifically is high level settings which might be admin-changed. the sort of thing that you might store in the app or web.config ultimately, but from teh DDD perspective should be set somewhere in the objects explicitly. For sake of argument, let's take as an example a web-based CMS or blog app. A given blog Entry entity has any number of instance settings like Author, Content, etc