ddd-repositories

which architecture is good for implementing in this project? [closed]

﹥>﹥吖頭↗ 提交于 2019-12-27 02:09:08
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . i am new in architecture .I have a MVC web application project and I want to use EF code FIRST .I want to use an architecture for this project.I want to use DDD(domain driven design) but it is for large project. i want a simple of DDD that support this things in my project: 1-repository pattern 2-IOC 3-service

Repository pattern for database that allows CRUD operations through Interops

旧巷老猫 提交于 2019-12-25 09:48:59
问题 The situation we are facing currently is Model Entities and database logic are tightly interweaved together which is making unit tests impossible. So, I decided to go with designing a Repository pattern. The basic structure of storage model what we see through Com interactions Root-Children[each child is another Root]. It's a tree structure. Understanding this, the Repository we designed is RootRepository for CRUD operations on root and ChildRepository internal to RootRepository for CRUD

How to properly define an aggregate in DDD?

旧街凉风 提交于 2019-12-23 13:39:20
问题 What would be a rule of thumb when designing an aggregate in DDD? According to Martin Fowler, aggregate is a cluster of domain objects that can be treated as a single unit. An aggregate will have one of its component objects be the aggregate root. https://martinfowler.com/bliki/DDD_Aggregate.html After designing aproximatelly 20 DDD projects I am still confused about the rule of thumb when choosing domain objects that would create an aggregate. Martin Fowler uses order and line-items analogy

How to make POCO work with Linq-to-SQL with complex relationships in DDD

人走茶凉 提交于 2019-12-23 13:15:17
问题 I am struggling to find a way to make POCOs work with Linq-to-Sql when my domain model is not table-driven - meaning that my domain objects do not match-up with the database schema. For example, in my domain layer I have an Appointment object which has a Recurrence property of type Recurrence. This is a base class with several subclasses each based on a specific recurrence pattern. In my database, it makes no sense to have a separate AppointmentRecurrences table when there is always a one-to

Aggregate for one entity

微笑、不失礼 提交于 2019-12-23 10:06:02
问题 In Domain-driven design if I want to use a repository I need to have an aggregate for it - as I understand. So I have a User, that has id, login, email, and password. A user is a domain Entity with unique Id. When i want to add a User to User repository, should I build first an Aggregate with only Aggregate Root that is my User entity and nothing more? It looks like a proxy to User in this case, unneeded layer. Or maybe I missed something here? Maybe User isnt an Entity, even if it looks like

Should I Pass a repository to a Domain Method that fires an Event

大兔子大兔子 提交于 2019-12-23 03:50:09
问题 slightly related to this question: Should I pass a repository to a domain object method that needs to fire an event after the methods actions have occurred and been persisted? In this case the system needs to send emails of after the domain object's status is changed. Whilst unlikely, it could happen that the status change would not be persisted in which case the email should not be sent. I could use a domain service to do the work, but all the logic of status changing belongs and is

Where to define the interfaces for a repository in an layered architecture?

只愿长相守 提交于 2019-12-21 07:30:10
问题 Background I'm trying to create a simple application to really understand the whole stack of DDD+TDD+etc. My goal is to dynamically inject the DAL repository classes at runtime. This keeps my Domain and Application Services layers testable. I plan on using "poor man's DI" to accomplish this for now ... so I would do this in a simple Console application near startup: // Poor man's DI, injecting DAL repository classes at runtime var productRepository = new SimpleOrder.Repository

Where to define the interfaces for a repository in an layered architecture?

拥有回忆 提交于 2019-12-21 07:30:07
问题 Background I'm trying to create a simple application to really understand the whole stack of DDD+TDD+etc. My goal is to dynamically inject the DAL repository classes at runtime. This keeps my Domain and Application Services layers testable. I plan on using "poor man's DI" to accomplish this for now ... so I would do this in a simple Console application near startup: // Poor man's DI, injecting DAL repository classes at runtime var productRepository = new SimpleOrder.Repository

Domain driven design repository implementation in infrastructure layer

China☆狼群 提交于 2019-12-20 12:37:14
问题 I got a question on dependencies of DDD layered architecture. If the Repository implementation is in the infrastructure layer, that means that infrastructure layer has a dependency on domain layer because Entities will be referenced in the Repository implementation. On the other side, the Domain layer can have references to the infrastructure layer if infrastructure services are used in the domain. Wouldn't this create a cyclic reference? 回答1: Look at the onion architecture it shows a good

How linq 2 sql is translated to TSQL

拟墨画扇 提交于 2019-12-19 11:43:46
问题 It seems Linq2sql doesn't know how to construct the TSQL while you transform linq2sql object into domain object with constructors. Such as: from c in db.Companies select new Company (c.ID, c.Name, c.Location).Where(x => x.Name =="Roy"); But when using settable attributes, it will be OK. from c in db.Companies select new Company { ID = c.ID, Name = c.Name, Location = c.Location }.Where(x => x.Name =="Roy"); I don't want to allow those attributes to be settable. How can I achieve this? And can