On 14 June 2014 10:56, GESCONSULTOR - Óscar Bou <[email protected]>
wrote:

> [snip]
>
> We also mentioned on IsisCon (but also I can remember Dan mentioned
> something similar on the mailing list as his intention for version 2) that
> domain objects (domain entity instances) could be "wrapped by default",
> acting as a "container" of the business logic and ensuring it was preserved
> by default when invoked  from other domain objects.
>
> [snip]
> Any thoughts?
>
>
Thanks for mentioning this idea too; I forgot to add it to my list.

Whether Isis 2.0 has the feature on by default, or is somehow a flag, not
sure.  Don't really want to have lots of flags to enable/disable features
in the framework, but maybe in this case it would be warranted.

That said, I'm still not sure if it could be implemented, though.  Wrapping
objects returned by repository queries is easy enough; the difficulty is in
handling objects that are loaded by lazy loading.  If you look in
IsisLifecycleListener there is the postLoad(InstanceLifecycleEvent ev)
method; this is the callback fired whenever JDO/DN loads an object for us.
 However, as you can see, the InstanceLifecycleEvent doesn't allow the
object loaded to be substituted (there is no setObject(...) method in the
interface).

I'll ask Andy Jefferson (DN lead) if I'm missing something.

Cheers
Dan



> Thanks,
>
> Oscar
>
>
>

Reply via email to