domain-driven-design

Asynchronous request management application design

I have a daemon which exposes RMI interface for submission of various potentially long running bulk operations. The daemon may also talk to workflow/BPM system as a part of request processing. This essentially means that the request processing (post submission) also has an asynchronous component to deal with; which probably would require...

Proper reconstitution of Aggregate objects in the Repository?

Assuming that no ORM (e.g. Doctrine) is used inside the Repository, my question is what is the proper way of instantiating the Aggregate objects? Is it instantiating the child objects directly inside the Repository and just assign it to the Aggregate Root through its setters or the Aggregate Root is responsible of constructing its child ...

Truly declarative language?

Hi all, Does anyone know of a truly declarative language? The behaviour I'm looking for is kind of what Excel does, where I can define variables and formulas, and have the formula's result change when the input changes (without having set the answer again myself) The behaviour I'm looking for is best shown with this pseudo code: X = ...

Define "Validation in the Model"

There have been a couple of discussions regarding the location of user input validation: http://stackoverflow.com/questions/659950/should-validation-be-done-in-form-objects-or-the-model http://stackoverflow.com/questions/134388/where-do-you-do-your-validation-model-controller-or-view These discussions were quite old, so I wanted to as...

DDD: Where to create entity objects?

I have three entities that must interact: User, SupportTicketand PhoneConversation. When someone calls in requesting help, the User should have a SupportTicket assigned to him, with a PhoneConversation assigned to the Ticked describing the call. My question is: In what entity should I put the method CreatePhoneSupportTicket() that crea...

Security Implementation In Domain Driven Design

Hi all, We're working on a web project that is built on Sharp Architecture. We've put all our interfaces to "Core" layer and put all the implementations to related projects. Just one question; For the security system we' ve just put the basic interfaces to Core layer and created the security service project for the implementation for ...

Where to start when doing a Domain Model?

Let's say I've made a list of concepts I'll use to draw my Domain Model. Furthermore, I have a couple of Use Cases from which I did a couple of System Sequence Diagrams. When drawing the Domain Model, I never know where to start from: Designing the model as I believe the system to be. This is, if I am modelling a the human body, I sta...

Where to include business logic in a domain driven architecture

I'm trying to learn effective DDD practices as I go, but had a fundamental question I wanted to get some clarity on. I am using ASP.NET WebForms and I am creating a situation where a user places an order. Upon order submission, the code-behind retrieves the user, builds the order from the inputs on the form, calls the User.PlaceOrder()...

Understanding Domain Driven Design

Hi I have been trying to understand DDD for few weeks now. Its very confusing. I don't understand how I organize my projects. I have lot of questions on UnitOfWork, Repository, Associations and the list goes on... Lets take a simple example. Album and Tracks Album: AlbumId, Name, ListOf Tracks Tracks: TrackId, Name Should i expose...

DDD and MVC: Difference between 'Model' and 'Entity'

I'm seriously confused about the concept of the 'Model' in MVC. Most frameworks that exist today put the Model between the Controller and the database, and the Model almost acts like a database abstraction layer. The concept of 'Fat Model Skinny Controller' is lost as the Controller starts doing more and more logic. In DDD, there is a...

Mixing Transaction Script pattern with DDD/CQRS

Hi all, Here is the situation, in order to support our legacy system, we need to insert to a table whenever a user logs in. This is basically an CRUD operation, so it doesn't really make sense to create repository/entity/command/event for this since this doesn't tie to any business rules at all. The only benefit to create a CQRS comman...

Is the design notion of layers contrived?

Hi all I'm reading through Eric Evans' awesome work, Domain-Driven Design. However, I can't help feeling that the 'layers' model is contrived. To expand on that statement, it seems as if it tries to shoe-horn various concepts into a specific, neat model, that of layers talking to each other. It seems to me that the layers model is too s...

Which are aggregates in this DDD application?

I have been doing ASP.NET for many years and now playing catch up with MVC and DDD. I understand the majority of the concepts. I am re-developing a website which is for a sports website. Its essentially a CRUD style application but would like to DDD for learning and flexibility purposes. Have chosen not to do CQRS as that seems overkill ...

CQRS - Should a Command try to create a "complex" master-detail entity?

I've been reading Greg Young and Udi Dahan's thoughts on Command Query Responsibilty Separation and a lot of what I read strikes a chord with me. My domain (we track vehicles which are doing deliveries) has the concept of a Route which contains one or more Stops. I need my customers to be able to set these up in our system by calling a...

Appropriate spot for security evaluations - business logic or data access

Pardon the length here...hopefully I didn't go overboard... I'm in the process of working on my first production MVC application and I'm trying to stick to DDD principles in the process. I've run into some questions related to how to deal with the security requirements of the application and thought I'd see if the SO community could of...

Is it good practice to use domain objects as keys?

Is is good practice to use domain objects as keys for maps (or "get" methods), or is it better to just use the id of the domain object? It's simpler to explain with an example. Let's say I have Person class, a Club class, and a Membership class (that connects the other two). I.e., public class Person { private int id; // primary ke...

Domain model question on inheritence

I need some advice on modeling the following movies domain. I have a person entity. This person can be an Actor, Director, Producer and Writer and will often be all. I don't want to dup data in each entity so feel it best to create an abstract base class called Person that each of the Director, Actor and Writer classes inherit from. This...

Aggregates and Value Objects: Delete?

Hi, I'm currently determining the entities, value objects and aggregates in a system. Say the following Entities have been identified: Customer, CustomerEmail, Email, CustomerAddress, Address, AddressType where Customers -> Emails is a many to many relationship, as is Customers -> Addresses (with an address type). These relationships ...

Are there any good patterns for handling list of entities

In "DDD" what is the best patterns for handling different versions of your entities, e.g. Entities in a list vs the full object. I would like to avoid the overhead of getting properties I do not need when displaying the entities in a list Would you have a separate entity type used in lists or just fill up your full entity type partially...

Inter-Aggregate Communication in CQRS + DDD + Event Sourcing

How should separate aggregate roots communicate with one another in an environment built on DDD principles using an event-sourced aggregate back-end? For instance, I have a Facility aggregate root (AR) which has a factory method responsible for creating a Booking AR. The Booking is a time-sensitive combination of a Person AR and a Faci...