You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Ivan Balashov <ib...@gmail.com> on 2007/04/11 17:55:27 UTC

Method call order while marshalling

Hi,

Just want to say a couple of things, which might have been already told, if
so, my apologies.

First, when I generate XML document from generated Java classes, it would be
much better not to depend on the order of the methods I have to call to
populate the Xml Object graph.
For example, when I need to add a child element by invoking
parent.setXXX(child)
method, I need to fully initialize and set up the child object, and only
then call parent.setXXX(). This is a bit annoying in my opinion, because it
limits my code style. We create an object graph, don't we, so why there are
dependencies on which object I attach to it first?

And secondly, the mail list. I understand that there is a sacred tradition
going back many years to have a mailing list for the project. But why no
forum? Or google groups? Just to post this question one needs to go to goole
mail, exchange a pack messages to subscribe, then regularly get messages
he's not quite interested in, then finally unsubscribe. Wouldn't a simple
forum be better? Not to mention the searching capabilities of mailling
lists. You have to use google to search threads online, which is worse than
using internal search tools.

That said, I want to thank Apache.org and XmlBeans for the magnificent work
they make publicly available. It is truly amazing.

-- 
Kind Regards
Ivan

Re: Method call order while marshalling

Posted by Ivan Balashov <ib...@gmail.com>.
Hi Jacob,

On 4/11/07, Jacob Danner <ja...@gmail.com> wrote:
>
> Hi Ivan,
> In response to your comments.
> 1) XMLBeans should preserve ordering regardless of the order of method
> invocation. Are you not seeing this? I know there is a JIRA issue open
> regarding setXXX() when <xs:any> occurs in the sequence? Is it
> possible this is what you are running into?
> https://issues.apache.org/jira/browse/XMLBEANS-319


No, this one is different. The problem here is that if I call
parent.setXXX(child),
and then child.setXXX(property), the last statement will not be reflected in
the resulting XML. But if I call the latter statement first, everything is
fine.
I think I'd better use addNewXXX() as Radu suggests.



> 2) I think this is standard apache infrastructure and might be better
> directed towards those alias'.
>
> Jacob Danner
>
>
>
> On 4/11/07, Ivan Balashov <ib...@gmail.com> wrote:
> > Hi,
> >
> > Just want to say a couple of things, which might have been already told,
> if
> > so, my apologies.
> >
> > First, when I generate XML document from generated Java classes, it
> would be
> > much better not to depend on the order of the methods I have to call to
> > populate the Xml Object graph.
> > For example, when I need to add a child element by invoking
> > parent.setXXX(child) method, I need to fully initialize and set up the
> child
> > object, and only then call parent.setXXX(). This is a bit annoying in my
> > opinion, because it limits my code style. We create an object graph,
> don't
> > we, so why there are dependencies on which object I attach to it first?
> >
> > And secondly, the mail list. I understand that there is a sacred
> tradition
> > going back many years to have a mailing list for the project. But why no
> > forum? Or google groups? Just to post this question one needs to go to
> goole
> > mail, exchange a pack messages to subscribe, then regularly get messages
> > he's not quite interested in, then finally unsubscribe. Wouldn't a
> simple
> > forum be better? Not to mention the searching capabilities of mailling
> > lists. You have to use google to search threads online, which is worse
> than
> > using internal search tools.
> >
> > That said, I want to thank Apache.org and XmlBeans for the magnificent
> work
> > they make publicly available. It is truly amazing.
> >
> > --
> > Kind Regards
> >  Ivan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
>
>


-- 
Kind Regards
Ivan

Re: Method call order while marshalling

Posted by Radu Preotiuc-Pietro <ra...@bea.com>.
Agreed with Jacob, wanted to add one more thing:

- for child elements of a complex type (I assume that's what you are
talking about when saying you need to first initialize the child
object), you have available methods like addNewXXX(); I would recommend
using those, they are faster than setXXX() and, to me, seem more natural
for constructing documents

Radu

On Wed, 2007-04-11 at 10:33 -0700, Jacob Danner wrote:
> Hi Ivan,
> In response to your comments.
> 1) XMLBeans should preserve ordering regardless of the order of method
> invocation. Are you not seeing this? I know there is a JIRA issue open
> regarding setXXX() when <xs:any> occurs in the sequence? Is it
> possible this is what you are running into?
> https://issues.apache.org/jira/browse/XMLBEANS-319
> 
> 2) I think this is standard apache infrastructure and might be better
> directed towards those alias'.
> 
> Jacob Danner
> 
> 
> 
> On 4/11/07, Ivan Balashov <ib...@gmail.com> wrote:
> > Hi,
> >
> > Just want to say a couple of things, which might have been already told, if
> > so, my apologies.
> >
> > First, when I generate XML document from generated Java classes, it would be
> > much better not to depend on the order of the methods I have to call to
> > populate the Xml Object graph.
> > For example, when I need to add a child element by invoking
> > parent.setXXX(child) method, I need to fully initialize and set up the child
> > object, and only then call parent.setXXX(). This is a bit annoying in my
> > opinion, because it limits my code style. We create an object graph, don't
> > we, so why there are dependencies on which object I attach to it first?
> >
> > And secondly, the mail list. I understand that there is a sacred tradition
> > going back many years to have a mailing list for the project. But why no
> > forum? Or google groups? Just to post this question one needs to go to goole
> > mail, exchange a pack messages to subscribe, then regularly get messages
> > he's not quite interested in, then finally unsubscribe. Wouldn't a simple
> > forum be better? Not to mention the searching capabilities of mailling
> > lists. You have to use google to search threads online, which is worse than
> > using internal search tools.
> >
> > That said, I want to thank Apache.org and XmlBeans for the magnificent work
> > they make publicly available. It is truly amazing.
> >
> > --
> > Kind Regards
> >  Ivan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: Method call order while marshalling

Posted by Jacob Danner <ja...@gmail.com>.
Hi Ivan,
In response to your comments.
1) XMLBeans should preserve ordering regardless of the order of method
invocation. Are you not seeing this? I know there is a JIRA issue open
regarding setXXX() when <xs:any> occurs in the sequence? Is it
possible this is what you are running into?
https://issues.apache.org/jira/browse/XMLBEANS-319

2) I think this is standard apache infrastructure and might be better
directed towards those alias'.

Jacob Danner



On 4/11/07, Ivan Balashov <ib...@gmail.com> wrote:
> Hi,
>
> Just want to say a couple of things, which might have been already told, if
> so, my apologies.
>
> First, when I generate XML document from generated Java classes, it would be
> much better not to depend on the order of the methods I have to call to
> populate the Xml Object graph.
> For example, when I need to add a child element by invoking
> parent.setXXX(child) method, I need to fully initialize and set up the child
> object, and only then call parent.setXXX(). This is a bit annoying in my
> opinion, because it limits my code style. We create an object graph, don't
> we, so why there are dependencies on which object I attach to it first?
>
> And secondly, the mail list. I understand that there is a sacred tradition
> going back many years to have a mailing list for the project. But why no
> forum? Or google groups? Just to post this question one needs to go to goole
> mail, exchange a pack messages to subscribe, then regularly get messages
> he's not quite interested in, then finally unsubscribe. Wouldn't a simple
> forum be better? Not to mention the searching capabilities of mailling
> lists. You have to use google to search threads online, which is worse than
> using internal search tools.
>
> That said, I want to thank Apache.org and XmlBeans for the magnificent work
> they make publicly available. It is truly amazing.
>
> --
> Kind Regards
>  Ivan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org