Where to implement Automapper in a DDD + layered architecture

To answer your specific question I will speak more generally about your architecture. The architecture you’ve devised for your project is subtly different from a typical architecture used with DDD. While the way you’ve partitioned responsibilities is typical, in DDD, domain classes aren’t responsible for their own persistence. In fact a mantra of DDD is … Read more

DDD Using Specification pattern for Validation

Although you may use your Specifications classes for validation, I would suggest you keep them as separate concepts within your domain. You may find that you need to re-use the same underlying specifications but need to return different “Failure Reasons” depending on purpose and context. See this article for more details. The author of the … Read more

How to avoid having very large objects with Domain Driven Design

The issues you are seeing aren’t caused by Domain Driven Design, but rather by a lack of separation of concerns. Domain Driven Design isn’t just about placing data and behavior together. The first thing I would recommend is taking a day or so and reading Domain Driven Design Quickly available as a free download from … Read more

Is Unit Of Work and Repository Patterns very useful for big projects?

Now, the first question should be, why do I need a repository or unit of work pattern at all? Couldn’t I just use the EF context from the controller, having the full power of directly writing the query I need and returning the data? Answer: You could, but the real intent behind is testability and … Read more

C# MongoDB: How to correctly map a domain object?

It is possible to serialize/deserialize classes where the properties are read-only. If you are trying to keep your domain objects persistance ignorant, you won’t want to use BsonAttributes to guide the serialization, and as you pointed out AutoMapping requires read/write properties, so you would have to register the class maps yourself. For example, the class: … Read more

Is it ok for entities to access repositories?

it’s not a horrible violation of DDD it’s a horrible violation of… well… it’s just plain horrible (i say this tongue in cheek) :). First off, your entity becomes dependent on having a repository… that’s not ideal. Ideally you’d want to have your repository create the Person and then assign it everything it needs to … Read more

Design Methodology: use case driven vs. domain driven

Use Cases focus on Users, Actions, and Processes. This is great from a business perspective, because everyone can see an abstracted view of what the system will provide. DDD focuses on creating software that solves problems. The ‘Who can solve this?‘ and the ‘What process will they follow?‘ come afterwards. DDD really gets to the … Read more

How to Organise a Domain Driven Design Project?

I try to keep things very simple whenever I can, so usually something like this works for me: Myapp.Domain – All domain specific classes share this namespace Myapp.Data – Thin layer that abstracts the database from the domain. Myapp.Application – All “support code”, logging, shared utility code, service consumers etc Myapp.Web – The web UI … Read more

What is an example of a task based UI?

The easiest way to generate a task based UI is to protect all attributes/properties of your models. i.e. remove all setters. From this (pseudo code): public class TodoTask { public Date getDateAssigned(); public void setDateAssigned(Date); public string getAssignedTo(); public void setAssignedTo(string); } to this: public class TodoTask { public Date getDateAssigned(); public string getAssignedTo(); public … Read more

techhipbettruvabetnorabahisbahis forumueduseduedueduseduseduseduedueduedus