domain-driven-design

CQRS, DDD synching reporting database

We are trying CQRS and DDD and event sourcing. Let's say I have a customer update an email address, which fires out CustomerUpdatesEmailAddress Event, this goes through to my operational (write DB) and updates the tables. Our system is designed such there is an ETL process that runs which takes operational data and updates the database (...

Domain Modeling Question

The site I am working on has the concept of a User and a Site. A User can join the global site and create mini sites within (www.globalsite.com/minisite). The Users can also Follow other mini sites created by other users. Think about it like if Twitter allowed you to join with one set of credentials and create different accounts, one for...

DDD: Repositories are in-memory collections of objects?

I've noticed Repository is usually implemented in either of the following ways: Method 1 void Add(object obj); void Remove(object obj); object GetBy(int id); Method 2 void Save(object obj); // Used both for Insert and Update scenarios void Remove(object obj); object GetBy(int id); Method 1 has collection semantics (which is...

Can the domain model and repositories be in seperate dlls?

Can the domain model and the repositories be in separate dlls? In a 3 tier architecture I guess I would put the domain model in the business layer and the repositories in the data access layer. I get confused as it is my understanding that the domain model uses the repositories while the repositories should return objects from the doma...

DDD: Question about Aggregate boundaries

Hi guys, I have a complicated scenario in which two aggregate boundaries sort of contradict each other. I have 2 Entities: Request and Mission. User creates Requests and later on he can create Missions and assign existing Requests to a Mission. Requests and Missions can be created independently. In other words, I don't need to have...

Where are order IDs allocated?

Sorry for the naive question; I'm still working through understanding DDD. Let's say I have an IOrderService. Is this where I would have a method GetNewOrderID? Or, I guess more generally, what is the right way to allocate new orders in a DDD scenario? ...

Are there any frameworks/libraries for Delphi that come close to the functionality offered by Bold/Eco?

Not sure what happened to Bold/Eco during the Borland/Codegear/Embarcadero transition but I sure miss it in the newer versions of Delphi. Anyone know of a framework that comes close? If not, maybe you could suggest a combination of libraries and components that comes close. ...

Is DDD fit for our scenario?

We are trying to come up with an API and serve data-intensive services to potential users. Our scenario: we are more of less a data vendor where we store massive amount of data in normalized database and use queries to retrieve them to be displayed in data-driven web applications. Now, we want to create an API that clients can use to cr...

What is the relationship between DDD and the “Onion Architecture”?

What is the relationship between Domain-driven design (DDD) and "The Onion Architecture" of Jeffrey Palermo? Is the Onion Architecture a subset of DDD? ...

Domain Modeling question / collections with NHibernate

Hi, Please consider the domain model shown below (simplified for brevity - no ids etc.) A Customer can comment on a Product only once. Lets assume (for reasons I don't want to get into here) that the Customer class cannot have a collection of Reviews that it owns. The Product is the main Aggregate root here. Often in this situation,...

Is Repository pattern an overkill

I have been using Repository pattern (DDD and POEAA) for some time. However some of our team members have argued that it is just an extra layer of abstraction and unnecessary. I can seen some benefit in their arguments. Modern ORM solutions (NHibernate or EF) have almost everything you need. I searched and found some article like this an...

Design approach (Domain driven or Service Driven)

Hi All, My problem statement is : I want to write design file management (add, copy, delete etc. operations). There are two approach : Service Driven approach Write file VO which contains only file attributes. For e.g. public Class File { private boolean hidden; private boolean read; private boolean write; publi...

Organize Project Solution w/ Interfaces for Repository

VS 2010 / C# Trying to organize a solution and looking for options for naming the project that will host the interfaces for the repository. I have: MyProject.Domain MyProject.WebUI MyProject.Repositories MyProject.Interfaces?? So far "Interfaces" is the best name i've come up with, but I don't like it. Any ideas/suggestions? ...

Preventing an object from being altered after it enters a certain state? (C#)

I have a use case that I've never really dealt with before. I have an object that after the user clicks "Save" should not be changed. Initially I created two objects, DraftObject and SavedObject. For the latter I created a constructor that only accepted the DraftObject and set each property as protected set. This works but does not seem...

How can I make messages (coming from the domain) format/markup ignorant?

I want to send back formatted messages from my domain, For example things like: (Bear with me this is not a real example, its just to illustrate my point) Hello Mr user, you cannot perform that task because: reason 1 reason 2 reason 3 I also want to show colors. Right now I am sending it from the domain already ma...

How do I model an object to track equipment / assets over time?

I've been trying to figure out the best way to model this entity, and I'm getting stuck. Here's the basic use case/story: We have equipment arriving on site. We won't know what the equipment is until it arrives. Once the equipment arrives on site it must be recorded as having arrived and whether it was idle or active. If it is active th...

What is the proper way of using DTOs in this case?

I have the following domain class: public class Product { public virtual Guid Id { get; set; } public virtual string Name { get; set; } public virtual IList<Product> RelatedProducts { get; set; } } I have the following DTO class: public class ProductDTO { public ProductDTO(Product product) { Id = product.I...

Dto and domain entities. Did I create my dto correctly?

I have the following domain entity: public class CartItem { public virtual Guid Id { get; set; } public virtual Guid SessionId { get; set; } public virtual int Quantity { get; set; } public virtual Product Product { get; set; } } I have the following DTO: public class CartItemDTO { public CartItemDTO(CartItem c...

Domain Driven Design - Interfaces for defining roles.

Hi, I’m currently in the process of developing a domain model for a new application and have reached the stage where I need to define relationships with classes of different types that may perform the same role, and am confused as to the best way to define the relationship. For example: public class Car { public IDriver driver { g...

How to convey the importance/role of application architecture to business heads & junior developers.

Hi there, This question is subjective and can reasonably only be answered by those seasoned developers with leadership experience and management personnel with a sound technical proficiency. For the past year I've pursued educating myself extensively in OOD to become a stronger programmer. In particular, reading and applying knowledge ...