Hi Werner, Thanks for your response. Please see my comments inlined below:> >
if I were you, I would stop worrying about Castor's use of reflection,> as this
is a one-time only penalty (as startup) if used correctly. One-time penalty of
reflection for building the class descriptor is ok, but using reflection for
every get/set of a field while marshalling / unmarshalling seems slow, since
there will be millions of get/set method calls.What is the correct way to avoid
reflection during marshalling / unmarshalling ? > Let me ask you a few
questions, though:> > a) Will you be using a mapping file ?> b) Have you
considered using the XML code generator to generate domain> classes (and
descriptor classes) from your XML schema(s) ? I'm starting with a set of Java
classes which are already in use by applications and cannot be changed. These
Java classesneed to be persisted in an XML store.I would prefer not to use a
mapping file unless the default Castor Java->XML mapping needs to be changed
for some class.> c) Have you already looked at the documentation of the>
XMLClassDescriptorResolver ? Yes but it doesnt seem to provide a way to avoid
using reflectionduring marshalling / unmarshalling.> d) Are you using Spring,
and would you like to integrate Castor with> Spring ?
No.
> > And how did you measure performance when comparing Castor to JAXB ? I> find
> > your questions very interesting, but you'd need to educate me a bit> more
> > about your environment, etc. I'm going by:(a) The generally accepted wisdom
> > that reflection is slow compared to normal Java method calls.(b)
> > Performance numbers from comparisons done by others. Thanks much, -Sanjeev
> > > > Regards> Werner> > Sanjeev Krishnan wrote:> > > > Hello,Is there a way
> > to configure Castor-XML to avoid using> > reflection tocall get/set methods
> > of objects during marshalling /> > unmarshalling ?Reflection is supposed to
> > be slower in general> > compared tocustom-generated code which calls the
> > get/set methods.E.g.> > it should be possible to generate FieldHandlers
> > usingcglib / asm /> > BCEL at runtime, has anyone done that ?JAXB2.x seems
> > to use generated> > code to call fields rather thanusing reflection is that
> > the reason> > why JAXB2.0 is faster than Castor ?Castor seems ideal for my
> > project> > (in terms of ease of use)however I'm trying to figure out if
> > its> > performance will be as good as JAXB.Thanks,-Sanjeev > >
> > _________________________________________________________________ > > Life
> > on your PC is safer, easier, and more enjoyable with Windows> > Vista®.
> > http://clk.atdmt.com/MRT/go/127032870/direct/01/> >
> > ---------------------------------------------------------------------> To
> > unsubscribe from this list, please visit:> >
> > http://xircles.codehaus.org/manage_email> >
_________________________________________________________________
Windows Live™: Keep your life in sync.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_012009