Hi fabio, I know that unit tests can be built for this scenario (after
all it is just software). Unfortunately rarely I see one coping with
this stuff in reference literature.
"I still think that BusinessRules based on instant-persistent-state
should
use something else than a simple access to a property... "
Can you clarify?
The Test() function is just an example. Its complexity or simplicity
is not in question (It could be as complex as you want, you would
still need to enforce this).
Considering that NHibernate does not have yet a way to enforce this in
such a manner I thought about something like this:
public class B
{
// some code
[Lock]
bool Test()
{
return this.propB == "Hello Word";
}
}
An interceptor would intercept a call to a method and check for this
attribute. If it was there, the it would mark the object as Dirty or
Lock to the current session (what should be used to force a version
check on commit? (considering that Flush would be done on Commit)).
What is the correct way to implement this interceptor with NHibernate?
Nuno
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---