domain-driven-design

Entity configuration management with DDD bounded contexts

╄→гoц情女王★ 提交于 2019-12-12 10:53:25
问题 I'm trying to implement multiple DDD bounded contexts as outlined here. This is an example context: I have an entity type configuration file for each entity with the appropriate FluentAPI mappings (reverse engineered using EF tooling). These configuration files also include the relationship configurations. e.g.: UserMap.cs // Relationships this.HasOptional(t => t.SecurityProfile) .WithMany(t => t.Users) .HasForeignKey(t => t.SecurityProfileCode); SecurityProfile and DomainPermission are not

Presentation <?> Domain <?> Persistence

元气小坏坏 提交于 2019-12-12 09:04:21
问题 Ok So I have a PERSISTENCE layer, which grabs data from Entity Framework and puts it in some classes of its own, "Models", identical to the DB ones. PRESENTATION layer, an MVC website DOMAIN layer, which is a project independent to everything. Has some classes (Models) but not exactly as on the DB, has some business logic and so on. How do I link these 3? (references) 回答1: In a typical 3-tier Application architecture , you usually make your Data Access Layer (Data Persistence Layer if you

How to name repository and service interfaces?

徘徊边缘 提交于 2019-12-12 08:27:55
问题 How do you name repository and service interfaces and their implementing classes? For example I have a model with the name Question . What would you name the repository (interface and implementation) and the service (interface/implementation). After reading these posts: Java Interfaces/Implementation naming convention and Interface naming in Java I reconsidered what I already had done :) 回答1: I think that there are roughly two approaches to naming in DDD: 1) Stereotype based. This is where

CQRS - When to send confirmation message?

半腔热情 提交于 2019-12-12 08:24:49
问题 Example: Business rules states that the customer should get a confirmation message (email or similar) when an order has been placed. Lets say that a NewOrderRegisteredEvent is dispatched from the domain and is picked up by an event listener that sends of the confirmation message. When that is done some other event handler throws an exception or something else goes wrong and the unit of work is rolled back. We've now sent the user a confirmation message for something that was rolled back. What

Should the rule “one transaction per aggregate” be taken into consideration when modeling the domain?

*爱你&永不变心* 提交于 2019-12-12 08:14:54
问题 Taking into consideration the domain events pattern and this post , why do people recomend keeping one aggregate per transaction model ? There are good cases when one aggregate could change the state of another one . Even by removing an aggregate (or altering it's identity) will lead to altering the state of other aggregates that reference it. Some people say that keeping one transaction per aggregates help scalability (keeping one aggregate per server) . But doesn't this type of thinking

What is the best way to build view model?

拟墨画扇 提交于 2019-12-12 08:05:54
问题 I'm using asp.net mvc with entity framework and starting to learn DDD. I'm working on project that contains surveys. Here's my domain model: public class Survey { public int? SurveyID { get; set; } public string Name { get; set; } public decimal MinAcceptanceScore { get; set; } public int UserFailsCount { get; set; } public IEnumerable<SurveyQuestion> Questions { get; set; } public IEnumerable<Prize> Prizes { get; set; } public IEnumerable<SurveyAttempt> UserAttempts { get; set; } } I need

Organizing the directory structure of my DDD-based web application?

╄→гoц情女王★ 提交于 2019-12-12 08:02:48
问题 I have started to look away from the normal MVC way of creating my web applications and have had a look at Domain Driven Design - DDD. From having Models alone, I now have Collections , Entities , DataMappers & Repositories in my application to work with. Full-fledged separation and modularity for sure, but now my directory structure is nothing but a complete mess! As I have never worked with a DDD-application in the past, I have little idea on how to organize my file structure. Would below

Domain Driven Design (Linq to SQL) - How do you delete parts of an aggregate?

筅森魡賤 提交于 2019-12-12 07:59:40
问题 I seem to have gotten myself into a bit of a confusion of this whole DDD\LinqToSql business. I am building a system using POCOS and linq to sql and I have repositories for the aggregate roots. So, for example if you had the classes Order->OrderLine you have a repository for Order but not OrderLine as Order is the root of the aggregate. The repository has the delete method for deleting the Order, but how do you delete OrderLines? You would have thought you had a method on Order called

DDD: refer to an entity inside an aggregate root by its identity

只谈情不闲聊 提交于 2019-12-12 07:49:43
问题 I'm stuck on finding the proper way to refer to entities located inside an aggregate root , when we only got their identities coming from URL parameters. I asked a previous question which ended up focused on value objects , so I'm starting with another example here. Let's say we want to modify an OrderLine inside an Order : The user goes to a page where he can see the Order summary along with all its Order Lines. The user clicks on the edit button next to an Order Line. He gets directed to

domain model sequence number

末鹿安然 提交于 2019-12-12 06:11:21
问题 I have a need to assign the next sequence number for a Project according to a given prefix code. So you wind up with alternate id numbers like PROJ_ABC_001, PROJ_ABC_002, PROJ_XYZ_001, PROJ_XYZ_002, etc. While this need is quite specific, I would suggest that there is a more general and common case where businesses use alternate ids that are sequential integers in order to identify different Customers, Projects, Orders - whatever. Of course these aren't primary keys in the database. And while