El lunes, 26 de marzo de 2018, 15:43:25 (UTC+2), Jeremy Evans escribió:

> The main issue is that an identity map is fundamentally the wrong 
> abstraction:
>
> obj1 = Model[1]
> obj2 = Model[1]
> obj2.foo = 1
> obj1.foo = 2
> obj2.save # uses foo = 2 instead of foo = 1
>
> You are modifying code to share an existing object instead of returning a 
> new object.  In the above example, it's pretty obvious, but in complex code 
> it may not be, and can be the source of numerous bugs as a result.
>

We assume that when loading many times an object, that object MUST be the 
same, because business logic that apply to it is consistent. Business logic 
layer is split from persistence layer in our case, so all changes operated 
to object are saved at once.

Perhaps you are considering a static repository, but we use one for each 
query, in a stateless environment, so there is no problem of complex cross 
logic between users. In that context, Identity Map is very useful :)

-- 
David

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sequel-talk+unsubscr...@googlegroups.com.
To post to this group, send email to sequel-talk@googlegroups.com.
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to