On Monday, March 26, 2018 at 2:39:09 AM UTC-7, [email protected] wrote:
>
> I am interested in your opinion about identity map. Why do yo think it 
> causes more problems that it solves?
>

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.

Think about why you are using an identity map.  What problems do you think 
it solves?

Thanks,
Jeremy

-- 
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 [email protected].
To post to this group, send email to [email protected].
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