domain-driven-design

Am I using service layer correctly?

Hi, I have been reading up on DDD and I think I may be using services wrong or at least in a not so ideal way. My service classes tend to have quite a few instance variables containing repository references and they seem to do a lot of work (i.e have a lot of methods). Is it advisable to create more focused services? Like one method per...

WPF & MVVM : best architecture for Time-consuming search results ?

I am designing the architecture for a module where a search takes place. the search takes some time, and I would like to have the UI to be responsive, so I get to delegate the retrieval of the data to a class that will do the search on a separate thread. Then, I can think of two options : either 1° : the search method returns a view...

How can DDD be applied to smart clients?

Almost all examples of DDD within the Alt .NET community are applied to web development; what I would like to see are some examples of DDD applied in scenarios where the client handles most of the business logic and the server is simply a web service for CRUD using DTOs [1]. I'm currently working on a product that has an anemic domain m...

Should repositories be both loading and saving entities?

In my design, I have Repository classes that get Entities from the database (How it does that it does not matter). But to save Entities back to the database, does it make sense to make the repository do this too? Or does it make more sense to create another class, (such as a UnitOfWork), and give it the responsibility to save stuff by h...

Is there a forms builder for Cocoa?

As I have a complex domain model (DDD) where I need to create a few hundred forms in the user interface, I'm looking for a generator, preferably embedding the apple layout rules, and data binding. This is crucial to get a uniform application appearance. I would prefer the generating to be of run-time instances (introspection), not stat...

Which layer should Repositories go in?

Which layer should the repository classes go in? Domain or Infrastructure? ...

What is the Future of Domain/Entity programming at Microsoft?

I have currently been looking into Domain programming solutions and trying to predicate the future of the technology for my current customer. Where is Microsoft going with this considering that there seems to be many different solutions depending on which technology your looking at. For example there is Entity Framework in .net and als...

Building of your Domain Objects?

I'm in the process of trying to learn Domain Driven design so i'm sure this will be the first of many questions (i can already think of at least a couple more but i don't want to fragment my questions). I'm using Dino Esposito's "Architecting Microsoft .NET Solutions for the Enterprise" which, in some cases, is very abstract. First o...

What's the difference between Data Modelling and Domain Modelling?

By the way - with reference to data modelling I'm referring to logical or conceptual data models - not physical ones. The question came up during a discussion at work; naturally I leapt to Wikipedia to get some basic definitions in place - hoping that they might clarify the difference - but they didn't... A conceptual schema or conc...

Methods and recommendations for testing persistence of entities

Everyone loves unit testing. But testing persistence of entities is a bit different. You are testing a process occurring across multiple layers using different languages. Your tests have side effects (in the sense that rows are being added / modified etc). I would like to know how you do this. For example, do your tests create a whole n...

NHibernate mapping many child entities to one entity

I currently have a bookings model such as: public class RoomBooking : Entity, IBooking { public virtual Client Client { get; set; } public virtual Address Address { get; set; } public virtual IList<BookingPeriod> BookingPeriods{get;set;}... public class BookingPeriod : Entity { public virtual IEnumerable<IBooking> Book...

DDD modeling, interaction between aggregate roots

Marked my aggregate roots with 1;2;3. Looks quite nice - almost like grapes. Thing I dislike is an entity that's marked with red arrow. Let's imagine that: AR #1 is company AR #2 is office AR #3 is employee Entity marked with red arrow is named Country Company sets the rules from which countries it hires employees (on hiring...

Membership.Provider And Asp.NET MVC2: Do I Really Need it?

I see a lot of articles and posts on how to create a custom MembershipProvider, but haven't found any explanation as to why I must/should use it in my MVC2 web app. Apart from "Hey, security is hard!", what are critical parts of the whole MembershipProvider subsystem that I should know about that I don't, because I've only read about how...

Avoiding getters and using DTOs for the retrieval of information when using DDD

Greg Young talks about avoiding getters and setters on domain objects when using Domain Driven Design. For the use case where I want information from a persistent store to be rendered to the screen, what would the object model look like when following this architectural pattern? Would I expect to see a DTO being retrieved directly from ...

Death of the Repository?

I have been hearing a lot about the death of the repository pattern. People using listen when such influential people such as ayende: http://ayende.com/Blog/archive/2009/04/17/repository-is-the-new-singleton.aspx speak. This is a direction which i really don't understand and hence my post. Maybe i don't get the point because of my li...

Handling Errors In DDD-Flavored ASP.Net MVC2 Web Application

What are "best practices" concerning error handling in an ASP.NET MVC2 web app that is DDD designed? For example, let's take the most common aspect of a web app, the login: UserController: Obviously coordinates a few domain objects to eventually log in or refuse the user, and redirect to other parts of the web interface as needed. In m...

WCF serialization and Value object pattern in Domain Driven Design

Hello, The book Domain Driven Design by Eric Evans describes pattern called value object. One of the important characteristics of a value object is that it is immutable. As an example I have a value object "Clinic" which must have a name and an id. To make it a value object I do not provide setters on name and id. Also to make sure th...

What's a good way to handle entities within an aggregate that persist to multiple databases

Hello everyone! I'm dealing with a design problem that I'm sure has a simple answer and/or has been solved before. I've been reading, thinking, and searching for solutions for quite a while, but nothing seems to really make sense. The gist of the issue is that I'm dealing with a series of legacy systems and databases and I'm trying to t...

Replacing repository pattern with an ORM?

This is a repost of another thread i created. I think my first post was a little rhetorical in nature so it was closed so hopefully i can word my question better. There seems to be a push by some of the industry heavy weights to recommend using an ORM over the repository pattern and building your on DL Layer. So in your application lay...

Should an Entity ever know anything about its DAO?

I have a chance to introduce NHibernate to my group by using it with some new components that are being added to a legacy application. I'm trying to get my head around using the DAO pattern with NHibernate, and am stumped with an architectural question. In my fictional example, let's say I have CarDAO and a Car entity: public interfac...