domain-driven-design

How do I effectively use SQLAlchemy with multiple DDD Repositories?

I have been trying to find some examples of how to implement the Repository pattern with SQLAlchemy. Specifically, implementing more than one Repository. In the case of multiple Repositories, I believe each Repository would be best implemented by maintaining a separate SQLAlchemy session. However, I have been running into a problem tryi...

How value objects are saving and loading?

Since there isn't respositories for value objects. How can I load all value objects? Suppose we are modeling a blog application and we have this classes: Post (Entity) Comment (Value object) Tag (Value object) PostsRespository (Respository) I Know that when I save a new post, its tags are saving with it in the same table. But how c...

How to organize a ASP.NET MVC solution (DDD)

Hello everyone. I am trying to start a new project (asp.net MVC) and I would like to apply some DDD rules I've learned in these last few months. I don't know how to organize my solution though. I would like to use Nhibernate but I don't want to use Fluent Nhibernate cause it must be something like an experiment. I've seen some examples w...

Repository and Service Design question

We are trying to find out the best practice when using DDD and we are having some discussions on what makes the most sense or is the "right way". Note: All code is pseudo code. Conceder the following: public interface IDomainEntityAService { void CreateMyObject(DomainEntityA myobject); DomainEntityA RetrieveDomainEntityA(long ...

DDD Business Model to Relational Model mapping

I'm trying to figure out where (in the various layers) the business entities should start and the object to table mapping end. Should business entities surface out of the repository layer or out of the service layer? I'm wondering cause initially i thought it should surface from repository layer, but let's see my concerns in this case. ...

Modeling loosely coupled domain model

Hello, The question doesn't really concerne DDD but would like to know if there is any way to model a loosely coupled domain model. What I mean by that ? I work for a software HR editor and we're planning to start a new application from scratch. We did an audit of all projects we did for our 150 customers and the fact is that we can't s...

Implementing DDD Entity class in C#

Hi, I'm now starting out on DDD, I've already found a nice implementation for ValueObject but I cant seem to find any good implementation for Entities, i want a generic base entity type which will have an ID(needed by the specification) and implement currect equality operations. Whats the most elegent solution? ...

Should there be a Service Layer in Asp.net mvc?

Should there be a Service Layer in Asp.net MVC between Controller and Repository? As Repository is there for only Data Access. Some business logic is leaked into Controller. This might create a problem if the same operation is used by classic Asp.Net client as we have to duplicate the logic in Controller. ...

How to adapt the Specification pattern to evaluate a combination of objects ?

I know that the Specification pattern describes how to use a hierarchy of classes implementing ISpecification<T> to evaluate if a candidate object of type T matches a certain specification (= satisfies a business rule). My problem : the business rule I want to implement needs to evaluate several objects (for example, a Customer and a Co...

Customer to Order, or Order to Customer in domain model

I am reading the book Applying-Domain-Driven-Design-Pattern. In its model design, it has the Order hold reference to Customer, but if it was me doing the design, i will probably have the Customer hold reference to Order. So, the question, when designing unidirectional relationship, how to decide the direction? ...

Are there any good hands-on Domain Driven Design courses?

I have been studying DDD in-depth on my own time; reading everything about it and doing some small projects here and there, but the one thing I'm missing is learning from and working with someone with a deep understanding and experience working with it. Are there any good courses that I can attend to get some of this experience? ...

Building a forms system using DDD

Hi, i'm building a form managment system, thats is, the system will contain many forms, will save them, and perform logic on them, I want to do it using the DDD approach. I want to support easy form layout later on using ASP.NET MVC, so far i see the domain like this: I'll have a base form entity, which should(for now) have a name, fie...

Nhibernate - how to delete children?

I'm working on a project with NHibernate that classes similar to the following: public class Parent { public IList Children {get;set;} // ... } public class Child { // ... } I've got the Children property set to cascade all / delete orphan. Since I'm using the aggregate pattern and instances of Child class will only ever ...

Is there a .NET porting of Domain Driven Design's "Time and Money" project?

Is there a .NET porting of Domain Driven Design's "Time and Money" project? ...

Should Domain Entities be exposed as Interfaces or as Plain Objects ?

Should Domain Entities be exposed as Interfaces or as Plain Objects ? The User Interface : public interface IUser { string FirstName { get; set; } string LastName { get; set; } string Email { get; set; } Role Role { get; set; } } The User Implementation (Implemented into LinqToSql Data Access Layer) : public class Us...

Should Business Objects or Entities be Self-Validated?

Validation of Business Objects is a common issue, but there are some solutions to solve that. One of these solutions is to use the standalone NHibernate.Validator framework, which is an attribute-based validation framework. But I'm facing into conceptual concern. Attribute validators like NH.Validator are great but the validation is on...

Unit testing Domain model objects

In our Core domain model design, we have got a class called "Category" whose constructor is internal by design. Since the constructor is internal, when writing unit test cases I won't be able to create the object of "Category". So my question, is it a best practice to make the constructor public just for making the "Category" class tes...

Should one use DI on POCO classes when doing DDD?

Say I have a nice domain model, using (constructor) DI where needed. Now I want to be able to persist this model, so I start adding infrastructure(Entity Framework) to do this. What happens now is that the persistence framework should be able to initialize your types using your IoC container. Maybe this is possible, maybe not. Anyway, w...

How do you deal with "defaults" when doing DDD

I am interested to see how people deal with decision trees when doing DDD. For example we have a requirement that when persisting new instance of particular type, some "default" associations have to be built (quite a few). User is free to change them later on though. So if one creates a decision table, how do you represent this in you do...

DDD with Grails

I cannot find any info about doing Domain Driven Design (DDD) with Grails. I'm looking for any best practices, experience notes or even open source projects that are good examples of DDD with Grails. ...