DDD: do I really need to load all objects in an aggregate? (Performance concerns)

Take a look at this Effective Aggregate Design series of three articles from Vernon. I found them quite useful to understand when and how you can design smaller aggregates rather than a large-cluster aggregate. EDIT I would like to give a couple of examples to improve my previous answer, feel free to share your thoughts … Read more

Alternatives to many-to-many relationships with CQRS

Supposing that both are aggregates, copy whatever author data you need into the Book aggregate upon adding the new book so that any subsequent commands have enough author data to work with. Now if the Author aggregate needs information about the books written by the author, then it could “subscribe” to the NewBookAdded event (technically … Read more

What’s the difference between Data Modelling and Domain Modelling?

Good question, the problem is that it depends on the definion of the terms, I think they differ slightly based on the sources. I would agree with previous answer – domain models are for describing the problem domain, at least the part you need to develop a solution. You describe all the various entities, their … Read more

What are the benefits of Persistence Ignorance?

Let me explain this with an example. Lets assume your are implementing an application using a classical SQL approach. You open recordsets, change data and commit it. Pseudo code: trx = connection.CreateTransaction(); query = connection.CreateQuery(“Select * from Employee where id = empid”); resultset = query.Run(); resultset.SetValue(“Address_Street”, “Bahnhofstrasse”); resultset.SetValue(“Address_City”, “Zürich”); trx.Commit(); With NHibernate it would look … Read more

DDD, Anti Corruption layer, how-to?

From the DDD book (Domain-Driven Design: Tackling Complexity in the Heart of Software) by Eric Evans: The public interface of the ANTICORRUPTION LAYER usually appears as a set of SERVICES, although occasionally it can take the form of an ENTITY. and a bit later One way of organizing the design of the ANTICORRUPTION LAYER is … Read more

Difference between specification and a policy?

The main idea behind SPECIFICATION is that it’s a predicate, which often implies using logical operators with it SPECIFICATION is an adaptation of an established formalism (Eric Evans DDD, p. 274) for example we can say that the box is red, i.e. satisfies some RedSpecification. We can declare some GreenSpecification, and even a composite RedOrGreenSpecification. … Read more

How do integrate “Users” in my DDD model with authenticating users?

Yes – very good question. Like @Andrew Cooper, our team also went through all this. We went with the following approaches (right or wrong): Custom Membership Provider Neither I or the other developer are fans of the built in ASP.NET Membership provider. It’s way too bloated for what our site is about (simple, UGC-driven social … Read more

Repository Pattern: how to Lazy Load? or, Should I split this Aggregate?

Am I misinterpreting the intent of the Repository pattern? I’m going to say “yeah”, but know that me and every person I’ve worked with has asked the same thing for the same reason… “You’re not thinking 4th dimensionally, Marty”. Let’s simplify it a little and stick with constructors instead of Create methods first: Editor e … Read more

Value Objects in CQRS – where to use

Ok I’ve changed my mind. I have been trying to deal with VOs a bunch lately and after watching this http://www.infoq.com/presentations/Value-Objects-Dan-Bergh-Johnsson it clarified a couple of things for me. Commands and Event are messages (and not objects, objects are data + behavior), in some respects much like DTOs, they communicate data about an event and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)