domain-driven-design

DDD-friendly ASP.NET MVC Model Binder?

I'm considering the value of a custom model binder that can instatiate immutable value objects defined in my domain layer. Then I can just pass them through the stack and set them on the appropriate entity. Has anyone tried? Had any luck? Think its a silly idea? ...

Domain Driven Design - How to use value object on the UI

Hi all, I was wondering how you use your ddd model within a web application. Within Eric Evan Cargo application there's the Cargo class which contains the value object Itinerary. Within Itinerary is a collection of Legs, again a value object. All value objects hide the surrogate id to the outside world. So when using this domain model,...

Repositories for Aggregate Root Only!

Hi, I have Category and Product entities. The relationship between the two is one to many. Since, Category is aggregate root I think I should only make a single repository ICategoryRepository which should also handle products. Ideas? ...

Domain Driven Design Question on Services and Repositories

I have two entities User and Course. A user can take several courses which makes the relationship one to many. But a single course can be taken by many students so it makes it many to many relationship. Now, I need to register a course for a user. My user entity has: public void AddCourse(Course course) { if (Cou...

Does Model Driven Architecture play nice with LINQ-to-SQL or Entity Framework?

My newly created system was created using the Model Driven Architecture approach so all I have is the model (let's say comprehensive 'Order' and 'Product' classes). These are fully tested classes that support the business of my application. Now it's time to persist these classes as objects on the harddrive and at some later time retrie...

Mac OSX/Cross Platform UML Sketching Tools?

A similar question had been asked a year or two ago, but I wanted to see if anyone has any new answers. I'm looking for a lightweight UML sketching tool that runs on Mac OSX. I really only care for diagramming and do not need code generation, etc. I prefer free, but am open to purchasing something if it's good and reasonable. I absolute...

Silverlight, RIA Services and protecting our data in objects

Silverlight is great, and with RIA services solves alot of stuff BUT. Why are we forced to have get; set on every model? I have been learned that if we have an Customer and the Customer Id should never change, then the Id property should be readonly, if the customer has an password that need to go through some logic before it shall be ...

How should I start DDD?

What is the best way to start Domain Driven Design? What are the recommended resources? EDIT: I mean, I'd like to know how to start learning DDD (the same way as to start TDD by reading K. Beck). ...

Domain Driven Design - Parent child relation pattern - Specification pattern

Hi all, I was wondering which of the following is considered to be a best practice when dealing with parent child relationships. 1) The following example seems to be a common practice, but when creating an instance of a child, it will be in an invalid state as long as it is not added to the parent. Couldn't this lead to problems regard...

Specification pattern implementation help

Hi all, I've a question regarding enforcing a business rule via a specification pattern. Consider the following example: public class Parent { private ICollection<Child> children; public ReadOnlyCollection Children { get; } public void AddChild(Child child) { child.Parent = this; children.Add(child); ...

methods in DDD entities vs services

Our team is fairly new to DDD, and are trying to implement some of the concepts in our current project. One question that has come up is whether to put methods into entity objects, or service objects. Some team members feel that entities should only hold values and all functionality should be contained in services. Others feel this ...

importance of object model in domain driven design

Our team is fairly new to domain driven design. We have a new project that just moved from design phase into coding phase. In the design phase, some team members created UML design models in Visio, while others just started coding. Also, with the pressures of build releases, many of our models are becoming out of date quickly. Is it ...

Where in a domain model is it best to keep a reference to the current user?

How should the current user be passed to the repository classes? The current user's credentials are needed for the connection string used by the repositories. Should each repository be instantiated by having the username and password passed as constructor parameters? That would mean that each domain object having a repository should be...

Domain Driven Design in Functional Programming?

It may sound like a stupid idea but I was just wondering if there is an equivalent of DDD in FP? It seems to me that DDD is only valid in OOP paradigm. Thanks. ...

LINQ2SQL, Persistence Ignorance and Domain Models

Has anyone here have used LINQ to SQL to support the persistence of domain models? I'm not planning to use the LINQ2SQL entity designer, just plain-old hand-coded XML mapping and I'm currently having roadblocks. I'm attempting to use it in a DDD example I'm doing, since my audience only knows LINQ2SQL. ...

DDD Book, Eric Evans: Please explain what is meant by "The FACTORY should be abstracted to the type desired rather than the concrete class(es) created."

In the book Domain Driven Design, by Eric Evans, in Chapter 6 in the section on "Factories" (page 139) it says the following: "The two basic requirements for any good FACTORY are: ... "2. The FACTORY should be abstracted to the type desired rather than the concrete class(es) created." Could you please elaborate on what is meant by t...

NHibernate + ASP.Net MVC + User Activity Feed

I am looking for the most appropiate way of dealing with a user activity feed on my social networking site. At the moment i have several activities which can appear on the news feed such as: Users joins the site User comments on a post User adds a a post to their favourites User adds a new post to the site Here is a simplified versio...

How to map View Model back to Domain Model in a POST action?

Every article found in the Internet on using ViewModels and utilizing Automapper gives the guidelines of the "Controller -> View" direction mapping. You take a domain model along with all Select Lists into one specialized ViewModel and pass it to the view. That's clear and fine. The view has a form, and eventually we are in the POST act...

Dealing with nested aggregates in DDD

I'm just getting started in DDD, and I'm having some trouble figuring out how to accommodate the relational nature of my data. I have what I believe would be considered my aggregate root, but the aggregate also has an aggregate of its own. Not wanting to violate the Law of Demeter, I'm wondering if I'm thinking about this wrong and am ...

Specification Pattern Unit Tests

We have recently adopted the specification patterns for validating domain objects and now want to introduce unit testing of our domain objects to improve code quality. One problem I have found is how best to unit test the validate functionality shown in the example below. The specification hits the database so I want to be able to mock...