domain-driven-design

DDD Entity and its identifier

I have an entity in my system, which naturally needs an identifier so that it can be uniquely identified. Assuming the database is used for generating the identifier with Hibernate, using the native strategy, then obviously the application code is free of this resposibility of assigning identifiers. Now, can an instance of that entity be...

DDD and ASP.NET - where do you use repositories?

Hi, I'm new to DDD. I have an existing ASP.NET application (not MVC) and I would like to start implementing a domain driven design. However, I'm not sure where I should call the repository from. For example if I had a customer repository with a Save method, my understanding is that I should not call the Save method from the customer en...

DDD: Aggregate Root -Design

Hello All, I have few questions here In an ordering system I am considering Order as Aggregate Root OrderLineItem belongs to Order. I can Ship the order to a End Customer or a Reseller Reseller can combine OrderLineItem from different orders and create a new Order and send to End Customer. While creating new order (from other orders...

Logical Model versus Domain Model

I am not a database guy. My understanding of data modelling is not extensive. From that limited understanding the logical data model is an abstraction of the physical data model, not containing anything specific to the specific storage product/medium. The logical data modelling does appear to involve business subject matter experts in th...

Showing changes in View when using CQRS & DDD with Domain Events & ServiceBus

I'm a little confused about the flow in a system using domain events to build the read model. Particularly, how do we deal with the fact that the user expects data (and its view) to change when they complete a command, but due to our system architecture (non-blocking calls to publish events) the actual database might not change before t...

Which .Net collection interface to use when in a domain model?

Using the Northwind schema as an example which collection interface would you use in the following circumstances. . Customer Customer has a collection of Orders. For the purpose of this example the Orders collection is readonly. Order An Order has collection of OrderDetails. An OrderDetail can be added to the collection. Employee ...

Domain Model Diagram

I am working on an rfp for a company. They want to keep things high level. They asked me to describe domain model and how it can be extended to support their unique data points. What is the best way to answer it. I have a domain model diagram but I don't want to go in detail with all data fields. I found out that people reviewing it wi...

ASP.NET MVC DDD E-commerce - Admin and front separation

Hello, I'm going to write an ASP.NET MVC 2 application using Domain Driven Design. I'm trying to figure out how to separate the Admin from the store front. I could create 2 MVC projects, but regarding the services for them, should they be in separate projects as well or could I use the CatalogManager, for example, for both, Admin and the...

Selecting Instances of an Interface Based On Specific Value

I'll start here with a little bit of background. We have an ASP.Net MVC web application that sits upon a structure roughly based upon the Onion Architecture concept. Therefore, we have the following (simplified) vertical structure: ASP.Net MVC controller layer Application service layer Business Service layer NOTE: The above is simpli...

DTO shape: flat, complex/nested, or a mixture of both

I have an MVC2 n-tier application (DAL, Domain, Service, MVC web) using a DDD approach (Domain Driven Design), having a Domain Model with repositories. My service layer uses a Request/Response pattern, in which the Request and Response objects contain DTO's (Data Transfer Objects) to marshal data from one layer to the next, and the mapp...

Which layer should scheduled task be put?

I'm trying to implement DDD application with layered architecture. I have: Infrastructure layer - a layer which implements technology specific parts of the application. Domain layer - a layer which contains domain model. Application layer - a layer which contains interferences to interact with domain model. And interfaces layer - a lay...

Domain driven design pattern clarification

Hi all Im trying to build a solution using a DDD approach. Ive created a set of entities, and some datamappers i use to remove the data persistence dependency from the entities. Is it correct of me, to use a datamapper like a "finder" class, i have methods like getById() getUsersByRanking() getByLastName() or should the datamapper ...

Working with Aggregates in DDD

Looking for some clarification on working with aggregate roots. If I have a model (a question paper) as follows; QUESTION PAPER ---> QUESTION ---> ANSWER and I have identified that the QUESTION PAPER is an aggregate root, if I want to select a answer for a question do I have to put a public method on the aggregate root or can I expose...

Which Layer for Domain Events, EventHandlers, Dispatcher

Hello, I have been reading about Domain Events and have seen codes from Udi's implementation(http://www.udidahan.com/2009/06/14/domain-events-salvation/) ,Mike Hadlow (http://mikehadlow.blogspot.com/2010/09/separation-of-concerns-with-domain.html), Jimmy Bogard and Jason Dentler's implementation. All in All I like the idea of events....

Custom URL's in a Rails App

Hello Everybody, This question is going to be very general because I do not know where to start. I want users of my service to be able to add their own custom url's. For example, www.[thierurl].com should be able to access their application's index and show pages. I've seen apps like Tumblr offer this functionality for their front fa...

Winforms application server communication

Hi, I am building a Winforms client that needs to communicate with a backend. This backend is build using Nhibernate (with a VERY rich domain model) , message queuing and other. Now i do know about communicating over the internet ( mostly mq stuff) but i am at total loss as to how to let my Client Winforms App talk to the Application s...

Alternatives to many-to-many relationships with CQRS

How do we model classic many-to-many relationships with CQRS/DDD? I know that both DDD and CQRS implementations and solutions tend to be domain-specific, so it may be difficult to come up with a general answer to this question. However, let's assume we have the familiar relationship between Book and Author. This is a classic many-to-ma...

How Can I Handle Concurrency with Persisted Calculated Properties in an Aggregate Root via NHibernate?

I have the need to persist a calculated property with an aggregate root. The calculation is based on child entities. I am using the root to add/remove the children via domain methods, and these methods update the calculate property. A child entity can be added to a particular root by multiple users of the system. For example, UserA can ...

How to avoid persistence logic in domain model?

My domain model looks like this: class Group { private List<Person> persons; public void AddPerson(Person p) { persons.Add(p); DoSideEffect() } public List<Person> GetPersons() {...} } Now I need to persist it. By DDD I cannot add any persistence attributes to this class so xml serializers will not work...

Domain Driven Design: Aggregate root problem

Hi all, currently I dont know how to identify an aggregate root. I've got the following classes. - Garage - Organisation - RuleSet - Rule - OrganisationRule - GarageRule A Garage can have many Organisations. A RuleSet is an entity where Rules are referenced to. There are Rules that are directly associated with a RuleSet. Then the...