I am reading http://en.wikipedia.org/wiki/Domain-driven_design right now, and I just need 2 quick examples so I understand what 'value objects' and 'services' are in the context of DDD.
Value Objects: An object that describes a characteristic of a thing. Value Objects have no conceptual identity. They are typically read-only objects an...
Hello:
A TimeSheetActivity class has a collection of Allocations. An Allocation is a value object (immutable) looking something like this:
public class Allocation : ValueObject {
public virtual StaffMember StaffMember { get; private set; }
public virtual TimeSheetActivity Activity { get; private set; }
public virtual DateTi...
Hi guys, a point of architectural style that I'd like your opinion on please:
My ORM has given me a User object which corresponds to a user of my system. I wanted to develop a bunch of methods for handling Users - GetByUsername(), Authenticate(), VerifyLoginPassword() etc. However it feels to me that some of these methods don't really b...
I'm modeling a very basic ASP.NET MVC app using NHibernate and I seem to be stuck on my design. Here's a sketch of my model:
As you can see this is VERY basic but I have some concerns about it. The User root entity and the Organization root entity are accessing the same Organization_Users entity child via two one-to-many relationship...
Let's say I have an AddProductToCartTask with a method Execute().
Now, the task is being called from a Controller. In the Execute method , there
is a check that if not met - the action is not performed.
Let's say the message returned would be: "You do not have enough bonus to buy
this product".
I thought about launching an event when ...
Warning acronym overload approaching!!! I'm doing TDD and DDD with an MVP passive view pattern and DI. I'm finding myself adding dependency after dependency to the constructor of my presenter class as I write each new test. Most are domain objects. I'm using factories for dependency injection though I will likely be moving to an IoC cont...
Is it okay to get a read-only collection from an aggregate without going through the root to get it? My model does some of this right now and I was wondering if that's an acceptable design. Thanks
Edit:
Here's an example
I have an aggregate root entity called UserAccount and another aggregate root called VideoStore. Users can have mu...
From Framework Design Guidelines:
DO NOT implement value equality on mutable reference types. [p-270]
From Eric Evans's DDD:
Each ENTITY must have an operational way of establishing its identity with another object. [p-94]
Should I treat overriding Object.Equals method as identity operation or just compare the Identity attrib...
I'm working on an application in which we are trying hard to keep Separation of Concerns as strongly as possible. We're finding that the cross-cutting concern of security creates a number of complications.
However, it looks like these can be mitigated using attributes and Aspect-Oriented Programming.
I understand it as far as applying ...
I apologize in advance if folks think this has been beaten to death. I've just spent the last few hours searching and reading many excellent posts here in SO but I'm still confused.
The source of my confusion is DTO vs. DDD and repositories. I want my POCO domain objects to have the smarts, and I want to get them from repositories. But ...
Hi all,
After several years of following the bad practice handed down from 'architects' at my place of work and thinking that there must be a better way, I've recently been reading up around TDD and DDD and I think the principles and practices would be a great fit for the complexity of the software we write.
However, many of the TDD sa...
We are about to design a site for rentacar reservations using asp.net. There is a change that the application will scale up and I was wondering what if using DDD would help in maintenance and performance. I was wondering on what if there are new similar sites designed using datasets and SPs or DDD. So my friends to DDD or go old fashion ...
We are trying to design a site that will support multilingual data and we use asp.net and nhibernate for O/R mapping. After some googling we decided that for us its best to create the entity classes containing all fields we need for supporting the default (english) language and for each multilingual class we would create a new class cont...
Where does the logic for deleting/not deleting dependent objects belong in DDD?
For instance one has a category that contains products:
class Category
{
IList<Products> products;
}
A rule might be that a category cannot be deleted unless it has no products.
Where does the logic belong that does the check for no products under th...
When programming in PHP I always try to create meaningful 'models' (classes) that correspond to tables in the database. I often encounter the following problem:
Assuming that I've created a database with two tables: authors and blogs, which both have a corresponding model in my application.
Let's say I want to print all the blogs along...
I have logic consisting of selecting a large number of records from one system, performing multiple transformations (based on business rules) and inserting them into another system.
It seems like a high performance (and memory) hit to instantiate each of these records as an object, perform transformations on them and then insert all of ...
I'm slightly confused about what exactly the Model is limited to. I understand that it works with data from a database and such. Can it be used for anything else though? Take for example an authentication system that sends out an activation email to a user when they register. Where would be the most suitable place to put the code for the...
Hi,
From the text "The Repository" pattern is a Mediator between the Domain and Data Mapper layers. Cool. So for example, maybe there is a Repository interface and Base Domain Object like so
public interface Repository<DomainT> where DomainT : DomainObject{
DomainT Get(Object id);
}
Then a concrete implementation would be
publ...
Are many-to-many table structures defined as Value Objects in DDD? What if my many-to-many structure has a unique id?
Also, what about 1-to-many relationships? For instance, if i have 2 structures Post & Comment with 1-to-many (respectively) wouldn't Comment be a Value Object since it technically cannot exist without a corresponding Pos...
I have been trying to learn and apply domain driven concept into my software development. The first thing that I try to do is creating my domain model based on business logic needs. I often also use OR Mapping tool, such as LLBLGen, NHibernate, or Linq to SQL, to create data model and data access layer. The domain model and data model, h...