I'm playing with an idea that when executing something server-side (from logical point of view) I generally do not want and do not need to have csla to clone the objects.
For example, you can have command doing some updates on a large set of business objects.
I have two main reasons for that:
- performance reasons
- NHibernate.NonUniqueObjectException - when using nhibernate as your database persistence layer. This happens when you get the business object and save the business object during the same nhibernate session. Most of nhibernate users should know what I'm talking about.
So, what do you think about this idea? Can I suppress the AutoCloneOnUpdate behavior when executing at server-side (logical location) by default.
It seems to me it should be always safe because the main reason for autoclone is to have separated object on the server from the client, because the server could change (and in most situations it does) the object while saving to DB (for example change timestamps, set id when inserting object) and when the transaction during that save fails it should leave the object at client intact.
I assume that server-side executions are always about doing some stuff that never wants to recover from "broken" object. Mostly you want to recover from that by rethrowing the exception that happend and having the client deal with that exception and reexecuting the server operation again.