Let's take an example UI for editing Customer information. The user edits 5 fields and presses "submit". Because we're good abstractionists, we've taken the edits to the 5 fields and make them different commands (describing the edit to a particular field).
The command handlers end up setting properties on objects that are persisted with...
Is it a violation of the Persistance igorance to inject a repository interface into a Entity object Like this. By not using a interface I clearly see a problem but when using a interface is there really a problem? Is the code below a good or bad pattern and why?
public class Contact
{
private readonly IAddressRepository _addressRepo...
In my latest ASP.NET MVC 2 application I have been trying to put into practice the concepts of Domain Driven Design (DDD), the Single Responsibility Principle (SRP), Inversion of Control (IoC), and Test Driven Development (TDD). As an architecture example I have been following Jeffery Palermo's "Onion Architecture" which is expanded on g...
Hi there I am using fluent Nhibernate and Id like to write tests for my mappings as shown below
I have a scenario where I have a User class, and a UserProfile class
The User class is an entity and the UserProfile is a value type, there is a 1:1 relationship between the two. How would I test the mappings based ont this, do I write separa...
Hi Im curious about how DDD is really implemented using Fluent Nhibernate. for example I have an entity class called User and another class called UserProfile, as far as Im concerned UserProfile is not an entity class but a value type, and should not realy have an identity as such if not associated with a User entity. Now to implement pr...
Hello All,
I am having some troubles thinking through a design issue and thought that the community may be able to help point me in the right direction. I am modeling an employee management system for my company and have come to a design question that has me stumped.
Here is the scenario:
I have an Employee class that employee class ...
For a rich domain driven design I want to use Guice dependency injection on JPA/Hibernate entity beans. I am looking for a similar solution as the Spring @configurable annotation for non-Spring beans.
Does anybody know of a library? Any code examples?
...
I'm reading Domain Driven Design Quickly and I'm having trouble understanding something.
When the author speaks of Entities, Value Objects and Services, is he speaking of the Domain Model (I mean, the concepts), or already about the implementation?
What is a Service? A Controller? A static class?
On p38 one can read:
When a signif...
I'm using PHP 5.2 to make a website
I like to have explicit names for my classes
I also have a convention saying 'the path and name of a file' match the 'name of the class'
So a class called:
ABCSiteCore_Ctrlrs_DataTransfer_ImportMergeController
would sit in my svn working copy at:
C:\_my\websrv\ABCCoUkHosting2\webserve\my_library\...
Hi All,
I am trying to understand Asp.Net MVC with DDD following is the structure of application according to the http://aspnetdesignpatterns.codeplex.com/
Application Layers
Presentation Layer => MVC views,
Controllers(MVC) => MVC
Controllers class,
Cached Service => ?,
Application Service => ?,
...
I've been doing some reading on Domain Driven Development but can't see how this would really change any development practices, besides maybe keeping our domain object names insync with elements in our requirement documents.
For those really into DDD, how has this change your development pracitces?
...
Just trying to get some opinions on whether or not CommandHandlers can/should communicate with other CommandHandlers.
Here is a simple case I just ran into. I have a ChangePasswordCommandHandler who's command looks like the following:
public class ChangePasswordCommand : Command
{
public string Email { get; }
public string OldP...
Hello!
I'm still in the process of learning DDD. I'm writing an ASP.NET MVC Application and I have several drop downs that I need to populate from the database. I've created mapped entities for every type (status, result, etc.)
What I can't figure out is from where I should be getting the data. Creating a separate repository for each ...
I'm trying to find a good, simple introduction to domain driven design, but that is proving to be difficult.
The books I have looked at all share the same problems.
They are massive 300+ pages. I really wish this practice would change with computer books.
They shine in chapter 1, explaining the introductory and basic concepts. Then w...
When creating domain model, we almost always have Id field or property for our entities which represents the primary key column of corresponding table in the database. My question is - if I have this key property that has nothing to do with the domain model (in other words, it's just database concern; Martin Fowler prefers to name it mea...
In employing Domain Driven design I often encounter an issue regarding the various perspective on a domain object, especially when using NHibernate. Perspectives are essentially ways to view an domain object. For example, a simplified model:
class Transaction
{
string Id { get; set; }
string CustomerName { get; set; }
DateTime Dat...
In the sample DDD project written by Eric Evans (http://domaindrivendesign.org/examples) there is a Cargo class which is an entity object and is mapped to db table using hibernate. That Cargo domain object consists of several value objects one of which is Delivery. This Delivery value object is quite complex as it has some 10 fields. Non...
Hello,
I use nhibernate as my orm and i am trying to implement something that looks straightforward but has become unneccessarily difficult. It concerns how to implement concurrent updates to an entity where it is expected that the entity will be updated simultaneously by more than one user in a multiuser scenario. The entity is an acc...
I am refactoring an old procedural PHP website into a tasty OOP application with a light sprinkling of Domain Driven Design for added flavour.
I keep stumbling upon cases where I have a need for classes that can have subclasses which are either entities or value objects.
An url object, for example. There are a zillion urls out there an...
Is it a good practise to decouple input checking from a model and have it handled elsewhere, say by a controller? If so, how could this be done from an MVC or DDD standpoint?
...