domain-driven-design

Design question about SPSecurity.RunWithElevatedPriviledges in multi-tiered design

I have a question re: performance and design. Crux of the problem is: do I wrap RunWithElevatedPriviledges around a sequence of methods all requiring its use (but the call is in the wrong layer), do I call it each time in the appropriate later. I am refactoring code that initially had 2 layers (front-end & database). I've now split thi...

WCF WPF and Domain Objects

Here is the scenario: There are some domain objects There are some WCF services exposing business services that interact with these domain objects There is a WPF application that is the UI, which calls the WCF services A pretty common set-up I would have thought. I am thinking of using DTOs between the WCF service and WPF app. There ...

DDD/NHibernate Use of Aggregate root and impact on web design - ex. Editing children of aggregate root

Hopefully, this fictitious example will illustrate my problem: Suppose you are writing a system which tracks complaints for a software product, as well as many other attributes about the product. In this case the SoftwareProduct is our aggregate root and Complaints are entities that only can exist as a child of the product. In other w...

Opinion wanted: Intercepting changes to lists/collections

Although BindingList<T> and ObservableCollection<T> provide mechanisms to detect list changes, they don't support mechanisms to detect/intercept changes before they happen. I'm writing a couple of interfaces to support this, but I want to canvas your opinion. Option 1: Lists raise events for each type of action Here, consumers might w...

Reading code of real production projects. How to find?

I really like the idea of reading others people code to improve your design skills. Open source can help here a lot. This can teach you basic OO principles. But I'm not writing frameworks, I'm writing code for real customers with quite complicated domain logic. There are lots of manuals of different MVC frameworks(like Create a blog wi...

Is a guid as identity field better in domain-driven design?

Is it easier to implement domain-driven design when using guids as identity fields instead of auto incrementing integers? With guids you don't have to jump to the database to get the actual value. ...

Domain Language: What is the best way to express?

One of my client sent me a requirement document and while reading that document there was a flash came in my mind. I started rewriting that big document similar like below. Do you think, an automated tool can generate a data model and rules by running through this. Say, if any client communicate their requirement in this approach, it wil...

Missing a part / layer in my app

Hello all! I have an asp.net mvc application with three layers: - data layer with entities and repository (nhibernate) pattern - service layer with services (functions), which communicates with data layer. - ui layer with asp.net mvc application, which communicates with service layer. The problem is that the data in my entities is diff...

DDD: what's the use of the difference between entities and value objects?

Entities and value objects are both domain objects. What's the use of knowing the distinction between the two in DDD? Eg does thinking about domain objects as being either an entity or value object foster a cleaner domain model? ...

App-level settings in DDD?

Just wanted to get the groups thoughts on how to handle configuration details of entities. What I'm thinking of specifically is high level settings which might be admin-changed. the sort of thing that you might store in the app or web.config ultimately, but from teh DDD perspective should be set somewhere in the objects explicitly. Fo...

DDD Concepts in N-Layer Development

After spending a couple months studying DDD methodology, I've now began to apply these concepts into actual products at my company. In fact, I've been tasked with creating a suitable and maintainable architecture for future development. We have decided to make use of the following technologies: EF4 (really v2), Unity The amount of inf...

Physical organization of bounded context/aggregates

In the context of DDD how is everyone physically structuring their files/folders when it comes to bounded context and aggregate roots? Does there need to be a physical representation of these or is it more just for discussions? I've tried to find evans and nilsson say something about physical layout but either I missed it or they don't ...

Which validation tags are appropriate for the model?

For proper separation of concerns on a domain/business assembly/layer it seems to me that a good practice would be to go ahead and system.ComponentModel.DataAnnotations mark up my fields in the domain assembly. Since most of these validations/annotations would be useful no matter what project type I wanted this domain to be usable in: W...

anemic domain model versus domain model

Being confused again after reading about this anti-pattern and the many concerns about it here on SO. If I have a domain model and capture the data that must be persisted in a data transfer object, does that make my domain model a wrapper around the data? In that case I would be using an anemic domain model. But if I add enough domain l...

DDD Projects Structure With WCF

Hi, I'm starting a new WCF-based project which is composed by an "Engine" and some desktop applications. But i found it difficult to make my project structure. Engine (Windows Service, which host WCF Services for Desktop applications access and host all my business logic) Desktop Application (Only Presentation) Shared MyProject.Core (...

EntityFramework or LinqToSql Entity Namespace

Hi, I want to specify entity namespace based on my domain structure. Usually like that : Infrastructure.SqlServer Customers (NS : Infrastructure.SqlServer.Customers) Customer Address Products (NS : Infrastructure.SqlServer.Products) Product ProductVariant ProductCategory How can i do that with LinqToSql or EntityFramework ? It...

DDD: Can a Value Object have lists inside them?

I'm not well versed in domain driven design and I've recently started created a domain model for a project. I still haven't decided on an ORM (though I will likely go with NHibernate) and I am currently trying to ensure that my Value Objects should be just that. I have a few VOs that have almost no behavior other than to encapsulate "li...

Can I use a rich domain model with WCF?

Is it possible to use DDD and a rich domain model if your application is like: windows client (WPF) windows service And communication happens with WCF? I'm used to have DTO's with only data state, and have business rules inside the Service layer, but everyone keeps telling me that I should have a rich domain model where data state ...

DDD "View Objects"?

Given an application that involves, say, Companies, I might have a Company class. I will have a data access layer that populates a List <Company>. However, there will be times (such as displaying a search result) where I only need to display the Company name, telephone and postcode properties, and it seems to me that populating the enti...

Mapping vs. service layer, or business logic position

I got a Product and a collection of Payers. The Payers can pay for the product in three different ways, either but manually set the percentage, by Payers income or by the value of the Payers respective holdings.How the product is paid is determined by an enum on the Product. In my persistence layer i got three classes, Product, Payer, a...