persistence-ignorance

DDD: Persisting aggregates

狂风中的少年 提交于 2019-12-23 09:59:29
问题 Let's consider the typical Order and OrderItem example. Assuming that OrderItem is part of the Order Aggregate, it an only be added via Order. So, to add a new OrderItem to an Order, we have to load the entire Aggregate via Repository, add a new item to the Order object and persist the entire Aggregate again. This seems to have a lot of overhead. What if our Order has 10 OrderItems ? This way, just to add a new OrderItem , not only do we have to read 10 OrderItems , but we should also re

Persistence ignorance and DDD reality

主宰稳场 提交于 2019-12-21 05:43:06
问题 I'm trying to implement fully valid persistence ignorance with little effort. I have many questions though: The simplest option It's really straightforward - is it okay to have Entities annotated with Spring Data annotations just like in SOA (but make them really do the logic)? What are the consequences other than having to use persistance annotation in the Entities, which doesn't really follow PI principle? I mean is it really the case with Spring Data - it provides nice repositories which

Can Persistence Ignorance Scale?

风流意气都作罢 提交于 2019-12-10 02:23:47
问题 I've been having a brief look at NHibernate and Linq2Sql. I'm also intending to have a peek at Entity Framework. The question that gets raised, when I talk of these ORM's is "They can't scale", so can they? From Google I get the impression they're able to scale well, but ultimately I suppose there must be a price to pay, Is it worth paying for a richer simpler business layer. 回答1: This is a good question, and IMHO they can scale just as well as any custom DAL. I've only used nHibernate so I

Custom Data Access in EF for POCO

不问归期 提交于 2019-12-08 07:50:50
问题 I am currently writing a WCF data service that is meant to extract data from any database in a predefined standard structure. I was thinking of using POCO entities. I can design my entities on EF designer and generate the POCO classes from it but the bit I struggling to understand is how to write data access layer and inject it into the DBContext. So for each different database, I'll have a data access layer that will retrieve data from a database or even an xml file and map the data to my

Can Persistence Ignorance Scale?

坚强是说给别人听的谎言 提交于 2019-12-05 02:36:52
I've been having a brief look at NHibernate and Linq2Sql. I'm also intending to have a peek at Entity Framework. The question that gets raised, when I talk of these ORM's is "They can't scale", so can they? From Google I get the impression they're able to scale well, but ultimately I suppose there must be a price to pay, Is it worth paying for a richer simpler business layer. This is a good question, and IMHO they can scale just as well as any custom DAL. I've only used nHibernate so I will focus only on it and the features it has which can help scale a system. Lazy Loading - Since it supports

What exactly is “persistence ignorance”?

做~自己de王妃 提交于 2019-11-27 12:20:42
Persistence ignorance is typically defined as the ability to persist & retrieve standard .NET objects (or POCOs if you really insist on giving them a name). And a seemingly well accepted definition of a standard .NET object is: "...ordinary classes where you focus on the business problem at hand without adding stuff for infrastructure-related reasons..." However, I see people describing NHibernate as a framework that allows persistence ignorance, and yet it is a framework that cannot work on any standard .NET object, only standard .NET objects that adhere to particular design requirements, for

What are the benefits of Persistence Ignorance?

北城以北 提交于 2019-11-26 14:27:06
I am a newbie in the DDD+TDD World. But I have been in programming for almost 9 years. Can someone please explain me the benefits of persistance ignornace ? Typical nHibernate application just pushes the dependency between class and database to mapping files. If I change Class files or Database, I have to change the mapping files. So isn't it just pushing the dependency by adding one more abstraction layer? In my opinion so far I don't think it's anything revolutionary. But I am not sure if I am missing something. Finally How can I test the mapping files ? There are chances bugs will appear

What are the benefits of Persistence Ignorance?

廉价感情. 提交于 2019-11-26 03:53:59
问题 I am a newbie in the DDD+TDD World. But I have been in programming for almost 9 years. Can someone please explain me the benefits of persistance ignornace ? Typical nHibernate application just pushes the dependency between class and database to mapping files. If I change Class files or Database, I have to change the mapping files. So isn\'t it just pushing the dependency by adding one more abstraction layer? In my opinion so far I don\'t think it\'s anything revolutionary. But I am not sure