Re: Prevayler - update data

Karl Wettin <[email protected]> Fri, 26 Oct 2012 20:16:28 +0200
Newsgroups gmane.comp.java.prevayler
Message-ID <[email protected]>
26 okt 2012 kl. 02:53 skrev Bruno:

> Is it a good option, for example in the GetEntity class to return a clone from the object? I don`t think so, but I`m asking hehe!

That's indeed probably not a very good idea and I can think of quite a few reasons. One that stands out is that in a real application with lots of aggregations an Entity is probably coupled to a very large portion of all the other business objects in your root, hence a deep clone of a business object might yield in cloning the whole prevalence layer. Another reason is that if there was a change to some business object it would not be available in a previously returned clone, but I suppose that even if I can't think of such a situation it's possible that one could be seeking such behavior.

But these are all hypotheticals. The question you've asked is an "X-Y-problem" (search for it on the web!) that have us chase our own tails. That rather than asking about a specific (and to us unknown) problem you ask about the solution you have thought of to that specific (and to us unknown) problem.


		karl

------------------------------------------------------------------------------
The Windows 8 Center 
In partnership with Sourceforge
Your idea - your app - 30 days. Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/

_______________________________________________
To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
_______________________________________________
"Databases in Memoriam" -- http://www.prevayler.org