Example: an Order object (aggregate root) has a collection of OrderLine objects (child entities). What's the URL add an OrderLine to an Order? Take into consideration the difference between using the aggregate roots' controller and having a separate controller for the child entity.
1: http://example.com/orders/add-orderline?order-id=42&...
I generally try and keep all related entities in the same repository. The following are entities that have a relationship between the two (marked with indentation):
User
UserPreference
So they make sense to go into a user repository. However users are often linked to many different entities, what would you do in the following examp...
What is the best practice to implement the following:
we have a classes Order and
OrderItem as parent-child.
Class OrderItem provides property Cost
On the OrdersList form we have to see MaxCost column = max(cost)
from Items collection
I found only one usefull solution here which won't break the DDD concpts: to add a usual prop...
I am starting a job with a mid size company working mostly on writing custom apps that interact with their ERP system. This is my first time doing this sort of work, so the ERP concept is new to me and I am learning it piece meal.
I have only written two apps so far and have learned the database model as I went and only as much as I n...
I found two collapsing problems :
You should use the same language
between domain experts and
development teams (DDD)
You should
use English for naming in your code
(.Net Design guidelines)
What if the domain experts don't speak English ?
...
Domain Driven Design encourages you to use a rich domain model. This means all the domain logic is located in the domain model, and that the domain model is supreme. Persistence becomes an external concern, as the domain model itself ideally knows nothing of persistence (e.g. the database).
I've been using this in practice on a medium-s...
The project currently I am working of requires a lot of searhing/filtering pages. For example I have a comlex search page to get Issues by data,category,unit,...
Issue Domain Class is complex and contains lots of value object and child object.
.I am wondering how people dealing with Searching/Filtering/Reporting for UI. As I know I hav...
We have a composite application built using the Composite UI Application Block (CAB)/Smart Client Software Factory (SCSF). To date, each module in our composite app has used its own set of DTO's, and business logic has been duplicated throughout the module, both in the UI layer and the Service layer. I would like to pursue more Domain-...
Suppose you're working with a customer's domain experts. You realize (or at least have a reasonable belief) that your model of their problem is clearer than theirs. How do you convince them that they should go your way.
In my case, it is fairly clear what the main thrust of the requirements are (e.g. a trading system for a product). Bas...
I am writing a simple web app using Linq to Sql as my datalayer as I like Linq2Sql very much. I have been reading a bit about DDD and TDD lately and wanted to give it a shot.
First and foremost it strikes me that Linq2Sql and DDD don't go along too great. My other problem is finding tests, I actually find it very hard to define good te...
In domain driven design, it appears to be a good practice to use Factories to create your domain objects in your domain layer (as opposed to using a direct constructor or IoC).
But what about using the domain object factories in a presenter layer. For instance, say that I was creating a domain object from user input obtained from the p...
Does it make sense to use interfaces for your domain object factories by default, or should interfaces be reserved for the factory classes only when you need them?
public IUserFactory
{
User CreateNewUser();
}
public UserFactory : IUserFactory
{
public User CreateNewUser()
{
return new User();
}
}
...
In a domain driven design where you're going for a non-anemic domain model how do you decide what to implement in your domain objects vs. service oriented methods?
EDIT: I asked this a different way with an example and got much better answers here
...
Hi,
I would like to ask for a reccomended solution for this:
We have a list of Competitions.
Each competition has defined fee that a participatior has to pay
We have Participators
I have to know has a Participator that is on a Competition paid the fee or not. I am thinking about 2 solutions and the thing is it has to be the most a...
In this question someone replies "You never let the domain object implementations call services by themselves!". Is this statement a hard fast rule of DDD or does it depend on your own application and architecture?
Contrived example:
As an example lets suppose we have a UserImage object in our model that gets populated from an uploaded...
Right now I'm trying to figure out a way to do things smarter, and in the course of doing so all i've managed to do is use a full bottle of excedrin in a single day.
Assume i have an interface called IRepository like so.
public interface IRepository<T>
{
T Get(int id);
void Add(T value);
void Update(T value);
void Del...
So let's say we have a domain object such as the following
public class Person
{
public string Name { get; set; }
public IList<PhoneNumber> PhoneNumbers {get; set; }
public IList<Address> Addresses { get; set; }
}
The Person is not valid until a name, phone numbers, and addresses have been entered. How do you guys handle this...
Let's say you have a domain entity User and you want to support the ability for a User to add an item to their shopping cart. Now, we want to make sure that the items in the shopping cart are unique, so we create the following function inside the User class:
function AddItemToCart(Item item)
{
// Add business logic to make sure ite...
I would like to know if you find the following pattern meaningful in domain driven design.
The domain layer consists of model and repository. The application layer consists of services that handles queries from the user interface, or from controllers in the Model-View-Controller pattern.
Details of the structure:
// Assembly Model:
p...
SHould I create a separate class for each object in an aggregate or should the objects be nested classes of a single aggregate class?
...