ddd-repositories

How to implement DDD using Spring Crud/Jpa Repository

落花浮王杯 提交于 2020-08-02 05:03:46
问题 I want to create an app by implementing DDD using Spring. Let's say I have a business entity Customer and an interface CustomerRepository. Since spring provides CrudRepository and JpaRepository to perform basic CRUD operations and other operations like finder methods by default I want to use them. So my interface becomes @Repository public interface CustomerRepository extends JpaRepository<Customer, Long>{ } But according to DDD, interfaces should be in domain layer and the implementation

Can a repository access another by DDD?

霸气de小男生 提交于 2020-07-11 07:03:03
问题 I am practicing DDD, and I have a very simple example, which looks like this currently: Polling getEventBus() -> Bus getEventStorage() -> Storage getMemberRepository() -> MemberRepository getCategoryRepository() -> CategoryRepository getBrandRepository() -> BrandRepository getModelRepository() -> ModelRepository getVoteRepository() -> VoteRepository MemberRepository MemberRepository(eventBus, eventStorage) registerMember(id, uri) -> MemberRegistered(id, uri, date) -> MemberRegistrationFailed

Can a repository access another by DDD?

╄→гoц情女王★ 提交于 2020-07-11 07:02:38
问题 I am practicing DDD, and I have a very simple example, which looks like this currently: Polling getEventBus() -> Bus getEventStorage() -> Storage getMemberRepository() -> MemberRepository getCategoryRepository() -> CategoryRepository getBrandRepository() -> BrandRepository getModelRepository() -> ModelRepository getVoteRepository() -> VoteRepository MemberRepository MemberRepository(eventBus, eventStorage) registerMember(id, uri) -> MemberRegistered(id, uri, date) -> MemberRegistrationFailed

Aggregate to JPA Entity mapping

喜夏-厌秋 提交于 2020-06-28 04:08:27
问题 In a DDD -project I'm contributing to, we're seeking for some convenient solutions to map entity objects to domain objects and visa versa. Developers of this project agreed to fully decouple domain model from data model. The data layer uses JPA (Hibernate) as persistence technology. As we all reckon that persistence is an implementation detail in DDD, from a developers' point of view we're all seeking for the most appropriate solution in every aspect of the application. The biggest concern we

Aggregate to JPA Entity mapping

泪湿孤枕 提交于 2020-06-28 04:08:10
问题 In a DDD -project I'm contributing to, we're seeking for some convenient solutions to map entity objects to domain objects and visa versa. Developers of this project agreed to fully decouple domain model from data model. The data layer uses JPA (Hibernate) as persistence technology. As we all reckon that persistence is an implementation detail in DDD, from a developers' point of view we're all seeking for the most appropriate solution in every aspect of the application. The biggest concern we

How entities covered with in an aggregate Root are saved in DDD?

别说谁变了你拦得住时间么 提交于 2020-03-25 18:54:13
问题 After reading lot of posts, I realised if an aggregate root exists for a concept/context, we need to have a single repository for that whole concept/context. If thats the case, I see there won't be any repositories for the internal entities. If so, how these internal entities are saved to database? I have a many internal entities under the aggregate root. So, wondering If I need to have all the saving of the internal entities under the aggregate root repository, it's going to be bloated.

Repository Pattern: how to Lazy Load? or, Should I split this Aggregate?

老子叫甜甜 提交于 2020-01-11 14:49:06
问题 I have a domain model that has the concept of an Editor and a Project. An Editor owns a number of Projects, and a Project has not only an Editor owner, but also a number of Editor members. Therefore, an Editor also has a number of "joined" Projects. I am taking a DDD approach to modelling this and using the Repository pattern for persistence. However, I don't grok the pattern well enough yet to determine how I should do this. I'm working on the assumption that Editor and Project are

Can the domain model and repositories be in seperate dlls?

耗尽温柔 提交于 2020-01-01 12:07:18
问题 Can the domain model and the repositories be in separate dlls? In a 3 tier architecture I guess I would put the domain model in the business layer and the repositories in the data access layer. I get confused as it is my understanding that the domain model uses the repositories while the repositories should return objects from the domain model, which would cause a circular dependency. I must be misunderstanding one or more of the above concepts. Any clarification would be greatly appreciated

Is there a mismatch between Domain-Driven Design repositories and Spring Data ones?

最后都变了- 提交于 2020-01-01 02:28:12
问题 DDD specifies repository per aggregate, but when embracing Spring Data JPA, we can leverage the benefits only when we declare interface per entity. How this impedance mismatch can be resolved? I'm hoping to try out repository interfaces encapsulated within the aggregate repository, is that a OK solution or anything better available? To given an example: Customer is the aggregate root and entities are like Demographics , Identification , AssetSummary etc. where each entity can benefit from

Using Generic Repository and Stored Procedures

陌路散爱 提交于 2019-12-30 03:15:07
问题 I am working on an existing application the uses the Generic Repo pattern and EF6 database first. I am calling a stored proc that returns a complex type that is not an existing entity in my entity models and therefore I am not sure what type to give. This is how my sp is being called from my service layer _unitOfWork.Repository<Model>() .SqlQuery("sp_Get @FromDateTime, @ToDateTime, @CountyId", new SqlParameter("FromDateTime", SqlDbType.DateTime) { Value = Request.FromDateTime }, new