domain-driven-design

Domain Modeling, Domain Objects in DDD

I'm really new to DDD and trying to grasp some of the concepts. Could someone explain me the idea behind Domain Modeling in DDD. I have already gone through wikipedia explanation: http://en.wikipedia.org/wiki/Domain_model but still seems like there are some gray areas in my understanding. Based on what I understood, domain modeling in...

MVC DDD: Is it OK to use repositories together with services in the controller ?

most of the time in the service code I would have something like this: public SomeService : ISomeService { ISomeRepository someRepository; public Do(int id) { someRepository.Do(id); } } so it's kinda redundant so I started to use the repositories directly in the controller is this ok ? is there some architect...

Clarification in dealing with collections with the repository pattern

If you have two repositories dealing with persistance to a relational DB, a personrepository that deals with "Person" objects, and an addressrepository which deals with "Address" objects, and a person object has a collection of addresses (probably lazy loaded). Obviously the personrepository would be used to persist changes to the person...

Validation on domain entities along with MVP

Hi, How do you apply validation in an MVP/domain environment ? Let me clearify with an example: Domain entity: class Customer { string Name; etc. } MVP-model class CustomerModel { string Name; etc. } I want to apply validation on my domain entities but the MVP model has it's own model/class apart from the domain entity...

Organize my domain objects in DDD while using ado entity framework

I have these 2 types of Users: Parents and Kids, both are Users, and have the same properties, but different methods. I Created Base User class and 2 class: Parent And Kid, both inherit form User base class, and each class have some different methods. User class is partial class, because the entity framework model has the same class bec...

are hibernate applications domain driven?

If I'm developing a hiberante application, am I also developing a DD model? My application does have a service layer ( which is in lines with the Observer pattern). Will there also be a Domain Layer wherein all the hibernate entities exist? I'm looking my application somehting like this: Do I need to know Domain Driven Design to wri...

Where to place joining classes?

Abstract example: If I have a system with domains of "Fleet" containing a "Vehicle" class, and "Customers" containing a "Driver" class, where would you place a joining class (which would detail lifecycle, insurance claims, and other information about the relationship)? Fleet and Customer concerns are equally important to the system and v...

Encapsulating a service call within an domain object method

Is this a valid object design ? I have a domain object where i inject a service and call a verify method to update the state of the object and if all goes well send a confirmation message. The code looks like: class Foo { String bar Service emailService public boolean verify() { bar = "foo" if(this.save()) { ...

POCO design question

Can/Should my POCO's encompass multiple Databases if applicable? The reason I ask is that I am in the process of refactoring a legacy Enterprise App that was built in stages. Unfortunately, each stage had it's own separate DB (at least they are all on the same SQL instance). Because of this I can easily see where a typical Business ...

Why do O/R Mappers seem to be the favored persistence approach for DDD users?

Why aren't there many DDD stories that use newer nosql tools such as db4o and Cassandra for persistence. In my view, the effort involved in O/R mapping seems too high for the returned value. Being able to report right off the database is the main advantage I can see for my projects. On the other hand, db4o seems to almost be the ...

Domain object properties and encapsulation

I have an Email object with two properties, label and value. System user need to verify their email before they can use it in the system. The verification process is very simple: Set an activation code for the email Send an email with the activation code to verify that the email is valid The email object looks like the following: ...

Where to put "domain services" in your domain model project

I've been working with S#arp Architecture but this can probably be applied to any DDD architecture (Domain / Core, Application Services, Infrastructure, and Presentation). There are many ASP.NET MVC examples that show the controller operating on the domain model through repository interfaces. In fact, the S#arp Architecture tutorial ha...

Is it fair to use Entity Framework just as an ORM tool without even thinking of DDD or models etc?

I have a database and bunch of related tables . I just want to use EF to reduce Data-Access code for CRUD operations on those table. I dont want to change the model or anything. I am using the models as It is generated(or using POCO). Is it fair to use EF just for this(to reduce the data-access code) or it is overkill and i should think...

Entity Framework CTP4 Modeling and mapping question/problem

I have a site where users are allowed to create as many micro-sites with in the main site as they like. A user can also set other users as moderators of their micro-site and users can follow other micro-site. I am not sure what I am doing wrong, (this seemed to work with CTP3), but when I try to do simple stuff like var site = _siteRep...

Securing/omitting selected properties of a domain entity in NHibernate (subclass, projection, ?)

Consider the following simplified scenario: public class Person { public string Name { get; set; } public int Age { get; set; } // restricted public string SocialSecurityNumber { get; set; } // restricted public string MothersMaidenName { get; set; } } So, in the application, many users can view Person data....

How to model Aggregates using Entity Framework?

While I have been dealing with domain-driven design (DDD) for quite some time now, I'm relatively new to Entity Framework (EF), and one question that came to my mind when using the Entity Framework Designer in Visual Studio was how Aggregates should be represented/modeled in EF. Following DDD best practices, Entities should only referen...

In domain driven design, can entities have their own repositories?

Hi all, I'm working a pretty standard e-commerce web site where there are Products and Categories. Each product has an associated category, which is a simple name-value pair object used to categorise a product (e.g. item 1234 may have a category "ballon"). I modelled the product as a root aggregate, which owns and knows how to modify i...

Abusing domain driven design

How can people abuse of Domain Driven Design ? too much too little information in the domain, what would you consider an abuse? In your design experience did you run into any situation that you considered that the design is just too much ? -Ken ...

How do you deal with DDD and EF4

Hi, I'm facing several problems trying to apply DDD with EF4 (in ASP MVC2 context). Your advaice would be greatly appreciated. First of all, I started to use POCO because the dependacy on ObjectContext was not very comfortable in many situations. Going to POCO solved some problems but the experience is not what I was used to with NHib...

Resolve Method with Unity

Hi Friends, I'm developing an web application with asp.net mvc 2, and I'm using NHibernate (session per request) and Unity (for dependency injection). In my Global.asax I'm managing my ISession something like this: public override void Init() { base.Init(); BeginRequest += OpenNHibernateSession; EndRequest += DisposeNHiber...