domain-driven-design

Opinions wanted: is it better to connect, or disconnect, the entities in the domain model?

I'm starting a new project; I wish to follow a DDD approach. We have talked to the business and achieved some insight into the domain in some detail (internet TV). The team is five strong and distributed. We have adopted the repository pattern for data-access. We are following a service-based approach overall; services are responsibl...

Getting String Sets into Presentation Layer

We're working on an hospital information system that is being written on C# and using NHibernate to map objects to database. MVC pattern is being used to separate business logic from UI. Here is the problem, How do you get variable sized different set of strings to UI? For example a Contact object have a property named City that holds ...

Accessing more than one data provider in a data layer

I'm working on a business application which is being developed using DDD philosophy. Database is accessed through NHibernate and data layer is implemented using DAO pattern. The UML class diagram is shown below. http://img266.imageshack.us/my.php?image=classdiagramhk0.png I don't know the design is good or not. What do you think? B...

Are we all looking for the same IRepository?

I've been trying to come up with a way to write generic repositories that work against various data stores: public interface IRepository { IQueryable<T> GetAll<T>(); void Save<T>(T item); void Delete<T>(T item); } public class MemoryRepository : IRepository {...} public class SqlRepository : IRepository {...} I'd like to w...

Data Transfer Objects, Domain Objects and Repositories

I'm trying to figure out how all these work together. I know that a DTO is basically just a container of data for the Domain Objects to pass back and forth to forms and such. Does the Domain object contain a DTO or do the DTO and the Domain Object happen to just have all of the same properties that will be mapped manually? If I am expos...

Samples for Domain Driven Design (esp .NET focused)

Ok so I've ordered Applying Domain-Driven Design and Patterns: Using .Net, but while I wait for it to arrive I'm looking at starting to apply the techniques in my current project. I really grasp the concepts quite well now, but when I try to apply them I get caught up with the execution and end up leaking my respsonsibilities across the ...

How can I still use DDD, TDD in BizTalk?

I just started getting into BizTalk at work and would love to keep using everything I've learned about DDD, TDD, etc. Is this even possible or am I always going to have to use the Visio like editors when creating things like pipelines and orchestrations? ...

Help! Evil services are killing my objects...

When I believed in American dream about encapsulation and polymorphism, intrusion of Web Services washed my objects off with RPC calls... When I cherished my resurrected PONOs, ugly army of barbarians called proxy objects conquered my lands... Later, peace seemed to come back with DDD and NHibernate on the server side, but the SilverLi...

How to implement "Last 20 something" property in your domain class?

Let's say I need to implement domain model for StackOverflow. If I am doing ORM, how can I define (and map) property for fetching "last comments" and other "last" things? It looks to me like this should be reflected in the domain model. Sometimes I might need "all comments" though... ...

How to rearchitect Hibernate DAO layer of ASP.NET app to move it to Silverlight?

Last try to get an answer on this. I have a simple ASP.NET app which uses Hibernate for data access. GUI can call methods on Customer object like "CalculateTotalSumOfOrders()". Lazy loading (even though it's not optimal) will work for me, and when Orders and OrderLines collections are referenced in the domain objects, they will get auto...

When to use domain driven development and database driven development?

Can anybody have good answer when should be database driven development be used and when should domain driven development be used. These both development approach have their importance in their respected areas. But I am not so clear which approach is appropriate in what type of situation. Any recommendation? ...

DDD + Public Parameterless Constructors - Should They Exist?

One of the tenants of DDD is to not allow your objects to enter an invalid state. To me this means there shouldn't be a public parameterless constructor because that's going to be an object in an invalid state 99% of the time. Is this a good way to move forward? It becomes a huge PITA when you just want to new-up a class real quick. ...

DDD repositories as singletons?

Quick question: Would it be a good or a bad idea to implement my domain-driven design style repositories as singletons? Why? Or should I maybe use a dependency injector container to manage my repositories and decide if they are singletons or not? I'm still reading DDD Quickly, and would like to see some good repository examples. ...

Can this mapping be done with (Fluent) NHibernate?

I have an Events table whose goal is to store actions done by web site users. An action basically alters or create a new row in a table X. This will allow me to store an history of all actions done by a user. As such, Events contains: a primary key column a text to describe the event (ex: "posted a comment") a discrimator column if nee...

NHibernate mapping with a class hierarchy whose base class is abstract and the discriminator is not a string

Here are the domain model classes: public abstract class BaseClass { ... } public class ChildClass : BaseClass { ... } Note that the parent class is abstract and this is what gives me some difficulties when comes the time to map with fluent nhibernate. My discriminator is a byte (tinyint in the DB). Because it is not a string and I c...

How to bind a GridView to a list of multiple types?

I get this error: System.Reflection.TargetException: Object does not match target type. when trying to bind a List<IEvent> where an IEvent can be an appointment, a birthday, or a few other calendar related event types. ...

For an introduction to Domain Driven Design, should one read Evans or Nilsson?

When ever domain driven design is discussed, recommendations are almost always made to read Applying Domain Driven Design and Patterns by Jimmy Nilsson and Domain Driven Design by Eric Evans. Ideally, one would read them both, but for someone who is new to DDD, which of the books above gives the most bang for the buck/hour in a heads up...

Which .NET frameworks allow you to create Business Entities first, then Database

Do any .NET frameworks allow you to create Business Entities first then Database. In other words allow you to use DDD / Persistence Ignorance method of backing into the database later. Any tools that allow the Models/Classes you have written to generate the SQL DDL and migration scripts. Feel free to rework my verbiage, and make it a be...

How to design an immutable object with complex initialization

I'm learning about DDD, and have come across the statement that "value-objects" should be immutable. I understand that this means that the objects state should not change after it has been created. This is kind of a new way of thinking for me, but it makes sense in many cases. Ok, so I start creating immutable value-objects. I make s...

How is Domain Driven Design different from just using a specification?

I read that Domain Driven Design is about concentrating on the problem domain instead of concentrating on the software. They say that it is easier to solve the complexities of the problem domain than the complexities of the software, because after you have solved the domain, you know better how to build the software, too. Also they say t...