users@jaxb.java.net

Re: [feature suggestion] Self-tracking of modified state by JAXB binding objects

From: Farrukh Najmi <farrukh_at_wellfleetsoftware.com>
Date: Sat, 12 Jan 2008 21:34:18 -0500

Thanks. You are right that this is not as simple as it may seem.
However, these issues can be ironed out with some careful thought.

I think we would need to identify different types of UML relationship
via customizations.
In a UML composition relationship, modifying the composed object would
modify parent object.
In a UML aggregation relationship, modifying an referenced object would
not modify the referring object.

What are some good resources to learn how to write XJC plugins ofr JAXB RI?
I have one blog here from Kohsuke:

<http://weblogs.java.net/blog/kohsuke/archive/2005/06/writing_a_plugi.html>

Any other resources that will help?

Is any one else interested in helping develop such a plugin?

Kenny MacLeod wrote:
> It woule be simple to implement this as an XJC plugin, I think.
>
> Also, modification tracking isn't as simple as you might think. For example, if I modify a child object, is the parent object "modified"? What if it's just an object reference, rather than a parent-child relation? It very quickly gets hard to generise this mechanism enough to auto-generate it.
>
> ________________________________________
> From: Farrukh Najmi [farrukh_at_wellfleetsoftware.com]
> Sent: 12 January 2008 15:36
> To: users_at_jaxb.dev.java.net
> Subject: [feature suggestion] Self-tracking of modified state by JAXB binding objects
>
> Something I have always felt th need for in JAXB generated binding
> classes is the tracking of modified or dirty objects. What would be
> really useful is to have a pair of accessor methods in each generated
> class at the base of a type hierarchy as follows:
>
> public boolean isModified();
> public void setModified(boolean isModified);
>
> And for each setter method in the generated bindings to call
> this.setModified(true);
> The object should be initialized to have the modified attribied be false.
>
> This would allow each JAXB binding object to self-track whether it has
> been modified since it was created or not.
>
> What does the JAXB RI team think of adding this feature as a
> impl-specific extension? If it makes sense for the RI then would it also
> make sense to consider this feature in a future version of the JAXB
> spec? It would be good to hear opinions from JAXB spec, RI and user
> community members on this. Thank you.
>
> --
> Regards,
> Farrukh Najmi
>
> Web: http://www.wellfleetsoftware.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>


-- 
Regards,
Farrukh Najmi
Web: http://www.wellfleetsoftware.com