users@jaxb.java.net

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

From: Kenny MacLeod <KennyM_at_kizoom.com>
Date: Sat, 12 Jan 2008 23:09:23 +0000

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