domain-driven-design

Aggregate or entity without business attributes

梦想与她 提交于 2020-01-25 01:21:17
问题 Regarding below excerpt, concerning cqrs and ddd, from Patterns, Principles, and Practices of Domain-Driven Design by Nick Tune, Scott Millett Does it mean that domain model on command side can omit most of business attributes ? How would it look like for eg Customer Entity? Could Customer entity omit FirstName, Surname etc? If so, where would these business attributes be? Only in read model in CustomerEntity? Or maybe apart from CustomerEntity containing all business attributes there would

How to build F# type fulfilling business rules?

别来无恙 提交于 2020-01-24 14:12:52
问题 I´m trying to build a type in F#, where when I get an object of that type I can be sure it´s in a valid state. The type is called JobId and it just holds a Guid . The business rule is: It must be a Guid - but no empty Guid. I´ve already implemented the type in C# but now I would like to port it to a F# class library. That´s the C# type: public sealed class JobId { public string Value { get; } private JobId(string value) => Value = value; public static JobId Create() => new JobId(Guid.NewGuid(

How to build F# type fulfilling business rules?

陌路散爱 提交于 2020-01-24 14:12:46
问题 I´m trying to build a type in F#, where when I get an object of that type I can be sure it´s in a valid state. The type is called JobId and it just holds a Guid . The business rule is: It must be a Guid - but no empty Guid. I´ve already implemented the type in C# but now I would like to port it to a F# class library. That´s the C# type: public sealed class JobId { public string Value { get; } private JobId(string value) => Value = value; public static JobId Create() => new JobId(Guid.NewGuid(

How to build F# type fulfilling business rules?

本秂侑毒 提交于 2020-01-24 14:12:05
问题 I´m trying to build a type in F#, where when I get an object of that type I can be sure it´s in a valid state. The type is called JobId and it just holds a Guid . The business rule is: It must be a Guid - but no empty Guid. I´ve already implemented the type in C# but now I would like to port it to a F# class library. That´s the C# type: public sealed class JobId { public string Value { get; } private JobId(string value) => Value = value; public static JobId Create() => new JobId(Guid.NewGuid(

nodejs: Node modules vs singleton classes

孤者浪人 提交于 2020-01-23 07:29:16
问题 PRE: I've read NodeJS modules vs classes but this is more specific. As part of some refactoring in Node I have a couple of Application Services (in DDD-terminology) which are technically implemented as Node modules. Since (in a DDD-world, an probably any other for that matter) Application Services should be singletons and since Node modules are guaranteed to be 1 'instance' only, it seems to me that this is an okay fit (modules trivially implement the 'singletonness') Is there any reason why

Using DDD, How Does One Implement Batch Processing?

妖精的绣舞 提交于 2020-01-22 15:22:12
问题 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 these object into the other system. Is the best way to achieve this in DDD to skip the classes/objects and do it straight through SQL, maybe a stored procedure

DDD - Modifications of child objects within aggregate

本秂侑毒 提交于 2020-01-22 09:30:34
问题 I am having some difficulty working out the best way to handle a fairly complex scenario. I've seen quite a few similar questions, but none addressed this scenario to my satisfaction. An Order (aggregate root) is created with multiple OrderLines (child entities). According to business rules, each OrderLine must maintain the same identity for the life of the Order. OrderLines have many (20+) properties and can be mutated fairly often before the Order is considered "locked". In addition, there

Is there a suggested pattern for using LINQ between the Model & DataAccess Layers in a DDD based Layered Architecture

会有一股神秘感。 提交于 2020-01-22 05:32:25
问题 I've been reading Tim McCarthy's awesome book on DDD in .NET. In his example application though, his underlying data access is using SqlCE and he's handcrafting the SQL inline. I've been playing with some patterns for leveraging Entity Framework but I've gotten stuck on how exactly to map the IRepository linq queries to the underlying data access layer. I have a concrete repository implementation called. public EFCustomerRepository : IRepository<DomainEntities.Customer> { IEnumerable

MVC DDD: Is it OK to use repositories together with services in the controller?

寵の児 提交于 2020-01-21 01:46:53
问题 most of the time in the service code I would have something like this: public SomeService : ISomeService { ISomeRepository someRepository; public Do(int id) { someRepository.Do(id); } } so it's kinda redundant so I started to use the repositories directly in the controller is this ok ? is there some architecture that is doing like this ? 回答1: You lose the ability to have business logic in between. I disagree with this one. If business logic is where it should be - in domain model, then

DDD and domain interfaces/classes

那年仲夏 提交于 2020-01-16 01:03:21
问题 In my application I have an assembly - MyApplication.Core which contains all of my domain objects - Customer, Order etc, as well as interfaces for repositories - ICustomerRepository, IOrderRepository I have another assembly - MyApplication.Data which contains concrete implementations of those interfaces - OrderRepository etc. The repositories are responsible for retrieving data from the DB and presenting it using the domain objects. One thing I'm not sure about is whether my domain objects