domain-driven-design

When do Categories exist as part of a domain or core of an application?

Previously whenever I've designed an application I've always treated categories as a major "top-level" piece of the design. But after becoming more interested in domain driven design and as database as "not" the model I'm not seeing categories in the same light anymore. To me categories exist as a UI batch processing helper for navigat...

Facebook Connect + MVC Model

Hey everyone, I am working on an ASP.NET MVC project and I am trying to get it integrated with facebook by using facebook connect API. Now, I am having a small problem in imagining how the conceptual layout would be. I am using the repository model in MVC, I have my own DB. I want to be able to fetch user’s information from FB, and may...

What's the best ORM for DDD?

I'd prefer a commercial solution. So not NHibernate. Now i'm playing with LLBLGen pro and i like it but it doesn't seem be DDD friendly. ...

Does an Anemic Domain Model mean you can't use utility/support classes as "helpers" for your domain model?

According to this definition, Fowler's concept of Anemic Domain Model is: a software domain model where the business logic is implemented outside the domain objects and With this pattern, logic is typically implemented in separate classes which transform the state of the domain objects. Fowler calls such external cl...

How do I name classes that a Repository uses for data access?

I've been programming for many years, recently i've been trying to apply some of the ideas from Domain driven design, but I still struggle with deciding on good names for certain parts of a system. Here's one example; I have a WCF webservice that returns "Computer" objects. The object is an aggregate root that contains child entities. ...

Separate table for Value Objects on NHibernate

Hello, I'm new to DDD and NHibernate. In my current project, I have an entity Person, that contains a value object, let's say Address. Today, this is fine. But maybe one day I will have a requirement that my value object (in this case Address), will have to become an entity. Before trying to model this on a DDD-way, in a more data-cent...

DDD Repository Awareness of Other Repositories

Is it generally acceptable that one repository can access another repository? Specifically in this case, I have one aggregate root that uses another aggregate root to determine what entities to add. It falls along the lines of an Item/Item Type relationship. The reason that the Item Type is an aggregate root is that they are separatel...

DDD: subclasses & root entities

Hello. I'm new to DDD. Let's say I have the typical entity Car class Car : Entity { public double MaxSpeed { get; set; } public Color Color { get; set; } /* ... */ } This entity, in my domain model, would be the root entity of an Aggregate. Now let's say I specialize cars. I create a Ferrari, and the happy owners of Ferr...

Caching calculated values (Sums/Totals) in the Database

Consider the Following object model (->> indicates collection): Customer->Orders Orders->>OrderLineItems->Product{Price} The app is focused on processing orders, so most of the time tables showing all the orders that match certain criteria are used in the UI. 99% of the time i am only interested in displaying the Sum of LineTotals, no...

DDD principlers and ASP.NET MVC project design

Two part questions I have a product aggregate that has; Prices PackagingOptions ProductDescriptions ProductImages etc I have modeled one product repository and did not create individual repositories for any of the child classes. All db operations are handled through product repository. Am I understanding the DDD concept correctly so...

In a Domain object how do I get a filtered set of related child entities without accessing repository?

Hi there, I'm using NHibernate, and have a one to may mapping set up. Let's call it Customer -> Orders This all works, and I can get all the orders for the customer. Now, I'd like to filter these orders, let's say I just want orders between run time determined dates. public class Customer { ... // mapped from NHibernate mappi...

Domain Driven Design: How to Retrieve Lists of Complex Data

I have been building a new application using my current understanding of domain driven design. So far I have a bunch of classes representing entities in my domain and a repository to retrieve from/persist to the database. The problem I am running into is that in the UI I have a need to display a few lists where the items in the list do...

Trouble getting started with SubSonic

I have a domain model in my head, and i am having problems building a SubSonic compatible db schema, it would realy help me get started if you could tell me how you would go at it for this example with 3 entities (could be SqlServer OR MySql doesn't matter to me) Subject- representing an educational subject (e.g. Trigonometry, Calculus)...

Motivating factors for composing a particular object?

I know there are LOTS of reasons why you would compose a certain object inside another one. Some schools of thought have made explicit the reasons for architecting a program a certain way e.g. 'data-driven design' or 'domain-driven design'. I'm still a beginner to OOP, and it's often hard for me to understand why one object should be con...

Domain-driven design (DDD) readings

Share with the community the best texts/blogs/articles/books on Domain-Driven Design you've read! ...

DDD: entity's collection and repositories

Suppose I have public class Product: Entity { public IList<Item> Items { get; set; } } Suppose I want to find an item with max something... I can add the method Product.GetMaxItemSmth() and do it with Linq (from i in Items select i.smth).Max()) or with a manual loop or whatever. Now, the problem is that this will load the full col...

DDD Repositories

Hi When creating a repository class, eg. CustomerRepository, should my methods be static? Or should I first instanciate the CustomerRepository class, and then call the public methods on the instance? Which approach is best and why? Thanks ...

What is the best practice for retrieving an item in a collection from a domain model?

What is the best practice for retrieving an object from a collection within a domain object with a specified property? For example, we have a car insurance application which has two classes: a Person with a list of Cars. If I always needed to retrieve a Car from a Person with the specified VIN, what is the best way to implement the met...

DDD: Should 'country' be a Value Object or an Entity?

Hi, 'country': Value Object or Entity in DDD? Opinions either way appreciated. And, where to store the table of country names/codes? DB? XML? In a class? Thanks! ...

Implementing Collections based (DDD) Repository with Hibernate

I'm trying to see if it's possible to implement a repository as a java.util.Collection (most likely a Map). Something along these lines: @Repository public abstract class HibernateRepository<K extends Serializable, V> extends AbstractMap<K, V> { @Autowired private SessionFactory sessionFactory; private Class<K> keyCla...