[betwixt] Sample code not working

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[betwixt] Sample code not working

Kirill Grouchnikov
Isn't anybody worried that the new Betwixt release doesn't
work on examples provided with it (not to speak of the real
objects)?

--- Kirill Grouchnikov <[hidden email]> wrote:

> Date: Sat, 30 Jul 2005 04:05:58 -0700 (PDT)
> From: Kirill Grouchnikov <[hidden email]>
> Subject: Example marshalling/unmarshalling not working
> To: [hidden email]
>
> Hi,
>
> I've tried the sample code from the Betwixt
> documentation,
> and it produces the following output:
>
> <?xml version='1.0' ?>  <person>
>     <age/>
>     <name/>
>   </person>
>
> 0 [main] WARN io.BeanReader  - Could not create instance
> of
> type: org.jvnet.bindmark.CheckBetwixt$PersonBean
> 16 [main] INFO io.BeanReader  - Cannot pop options off
> empty stack
> null
>
> The marshalling does not pick up the values, and the
> unmarshalling fails. I've attached the code i'm running
> (the main function performs both marshalling and
> unmarshalling).
>
> Kirill
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection
> around
> http://mail.yahoo.com >
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [hidden email]
> For additional commands, e-mail:
[hidden email]


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

attachment0 (211 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [betwixt] Sample code not working

Dion Gillard-2
Sure. Do you know if the tests work or not?

On 8/4/05, Kirill Grouchnikov <[hidden email]> wrote:

> Isn't anybody worried that the new Betwixt release doesn't
> work on examples provided with it (not to speak of the real
> objects)?
>
> --- Kirill Grouchnikov <[hidden email]> wrote:
>
> > Date: Sat, 30 Jul 2005 04:05:58 -0700 (PDT)
> > From: Kirill Grouchnikov <[hidden email]>
> > Subject: Example marshalling/unmarshalling not working
> > To: [hidden email]
> >
> > Hi,
> >
> > I've tried the sample code from the Betwixt
> > documentation,
> > and it produces the following output:
> >
> > <?xml version='1.0' ?>  <person>
> >     <age/>
> >     <name/>
> >   </person>
> >
> > 0 [main] WARN io.BeanReader  - Could not create instance
> > of
> > type: org.jvnet.bindmark.CheckBetwixt$PersonBean
> > 16 [main] INFO io.BeanReader  - Cannot pop options off
> > empty stack
> > null
> >
> > The marshalling does not pick up the values, and the
> > unmarshalling fails. I've attached the code i'm running
> > (the main function performs both marshalling and
> > unmarshalling).
> >
> > Kirill
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection
> > around
> > http://mail.yahoo.com >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > [hidden email]
> > For additional commands, e-mail:
> [hidden email]
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>


--
http://www.multitask.com.au/people/dion/
"You are going to let the fear of poverty govern your life and your
reward will be that you will eat, but you will not live." - George
Bernard Shaw

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [betwixt] Sample code not working

Kirill Grouchnikov
Should i be running the tests? I've downloaded betwixt and
all dependencies (commons, xml, ...), and ran the sample
code for writing bean to xml and reading bean from xml.

The writing didn't produce values for subelements, and the
unmarshaling failed completely with two error messages.

Kirill

--- Dion Gillard <[hidden email]> wrote:

> Sure. Do you know if the tests work or not?
>
> On 8/4/05, Kirill Grouchnikov <[hidden email]>
> wrote:
> > Isn't anybody worried that the new Betwixt release
> doesn't
> > work on examples provided with it (not to speak of the
> real
> > objects)?
> >
> > --- Kirill Grouchnikov <[hidden email]> wrote:
> >
> > > Date: Sat, 30 Jul 2005 04:05:58 -0700 (PDT)
> > > From: Kirill Grouchnikov <[hidden email]>
> > > Subject: Example marshalling/unmarshalling not
> working
> > > To: [hidden email]
> > >
> > > Hi,
> > >
> > > I've tried the sample code from the Betwixt
> > > documentation,
> > > and it produces the following output:
> > >
> > > <?xml version='1.0' ?>  <person>
> > >     <age/>
> > >     <name/>
> > >   </person>
> > >
> > > 0 [main] WARN io.BeanReader  - Could not create
> instance
> > > of
> > > type: org.jvnet.bindmark.CheckBetwixt$PersonBean
> > > 16 [main] INFO io.BeanReader  - Cannot pop options
> off
> > > empty stack
> > > null
> > >
> > > The marshalling does not pick up the values, and the
> > > unmarshalling fails. I've attached the code i'm
> running
> > > (the main function performs both marshalling and
> > > unmarshalling).
> > >
> > > Kirill
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> protection
> > > around
> > > http://mail.yahoo.com >
> >
>
---------------------------------------------------------------------

> > > To unsubscribe, e-mail:
> > > [hidden email]
> > > For additional commands, e-mail:
> > [hidden email]
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> >
>
---------------------------------------------------------------------

> > To unsubscribe, e-mail:
> [hidden email]
> > For additional commands, e-mail:
> [hidden email]
> >
> >
> >
>
>
> --
> http://www.multitask.com.au/people/dion/
> "You are going to let the fear of poverty govern your
> life and your
> reward will be that you will eat, but you will not live."
> - George
> Bernard Shaw
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [hidden email]
> For additional commands, e-mail:
> [hidden email]
>
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [betwixt] Sample code not working

robert burrell donkin
On Wed, 2005-08-03 at 23:48 -0700, Kirill Grouchnikov wrote:
> Should i be running the tests?

i think that dion was trying to establish whether it's the local
environment. if you're building from source then running the tests is a
good way to discover whether everything's ok. since you're using a
binary, is it the latest release (0.7)?

> I've downloaded betwixt and
> all dependencies (commons, xml, ...), and ran the sample
> code for writing bean to xml and reading bean from xml.

which sample code?

it doesn't look like the code on the getting start page, not like the
tutorial. i'm going to guess that you're running one from the example
page (please correct me if i'm wrong)...

> The writing didn't produce values for subelements, and the
> unmarshaling failed completely with two error messages.

i've just pulled the code from the website and run it in ecplise. i get
the following trace from the read sample:

INFO: Cannot pop options off empty stack
PersonBean[name='James Smith',age='25']04-Aug-2005 22:50:30
org.apache.commons.betwixt.expression.Context popOptions
INFO: Cannot pop options off empty stack

which is right (the person bean is populated)

for the write i get;

<?xml version='1.0' ?>  <person>
    <age>21</age>
    <name>John Smith</name>
  </person>

which is also correct.

so, these examples work fine for me. so, i think that it's probably some
kind of environmental or setup issue. the best thing to do would be to
run again with logging turned up nice and high.

this bit of the trace:

Could not create instance of type:
org.jvnet.bindmark.CheckBetwixtPersonBean

suggests to me that you have an issue with your classpath, access
permissions on the bean or don't have an empty constructor for the bean,

- robert



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [betwixt] Sample code not working

Kirill Grouchnikov
Robert

> i think that dion was trying to establish whether it's
> the local
> environment. if you're building from source then running
> the tests is a
> good way to discover whether everything's ok. since
> you're using a
> binary, is it the latest release (0.7)?

I'm using 0.7 binaries.

> which sample code?

The one from
http://jakarta.apache.org/commons/betwixt/guide/examples.html

I've just put everything in one class, and the mian
function performs both marshalling and unmarshalling.

> it doesn't look like the code on the getting start page,
> not like the
> tutorial. i'm going to guess that you're running one from
> the example
> page (please correct me if i'm wrong)...

You are correct. In addition, the code from the example
page uses 3 deprecated functions.

> > The writing didn't produce values for subelements, and
> the
> > unmarshaling failed completely with two error messages.
>
> i've just pulled the code from the website and run it in
> ecplise. i get
> the following trace from the read sample:
>
> INFO: Cannot pop options off empty stack
> PersonBean[name='James Smith',age='25']04-Aug-2005
> 22:50:30
> org.apache.commons.betwixt.expression.Context popOptions
> INFO: Cannot pop options off empty stack
>
> which is right (the person bean is populated)
>
> for the write i get;
>
> <?xml version='1.0' ?>  <person>
>     <age>21</age>
>     <name>John Smith</name>
>   </person>
>
> which is also correct.
>
> so, these examples work fine for me. so, i think that
> it's probably some
> kind of environmental or setup issue. the best thing to
> do would be to
> run again with logging turned up nice and high.

How do i set up the logging nice and high? Not all the
world is using commons, you know.

>
> this bit of the trace:
>
> Could not create instance of type:
> org.jvnet.bindmark.CheckBetwixtPersonBean
>
> suggests to me that you have an issue with your
> classpath, access
> permissions on the bean or don't have an empty
> constructor for the bean,

This class is inner private static and has public
constructor.

Kirill

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [betwixt] Sample code not working

Kirill Grouchnikov
So, two things that finally made the code work:

1. Betwixt can not handle private static inner classes as
beans, only public static inner classes. This is true even
if the marshalling is done in the outer class which has
immediate access to its private static class. Is it a bug?

2. Using ByteArrayOutputStream as an underlying stream for
BeanWriter requires closing the BeanWriter (unlike the case
with StringWriter) to produce the XML. Is it a bug?

3. Why the default configuration of BeanReader produces
INFO messages? Why do i need to see them, and how do i
change the log level *programatically (without property
file)* not to see them?

Thanks
Kirill

--- Kirill Grouchnikov <[hidden email]> wrote:

> Robert
>
> > i think that dion was trying to establish whether it's
> > the local
> > environment. if you're building from source then
> running
> > the tests is a
> > good way to discover whether everything's ok. since
> > you're using a
> > binary, is it the latest release (0.7)?
>
> I'm using 0.7 binaries.
>
> > which sample code?
>
> The one from
>
http://jakarta.apache.org/commons/betwixt/guide/examples.html

>
> I've just put everything in one class, and the mian
> function performs both marshalling and unmarshalling.
>
> > it doesn't look like the code on the getting start
> page,
> > not like the
> > tutorial. i'm going to guess that you're running one
> from
> > the example
> > page (please correct me if i'm wrong)...
>
> You are correct. In addition, the code from the example
> page uses 3 deprecated functions.
>
> > > The writing didn't produce values for subelements,
> and
> > the
> > > unmarshaling failed completely with two error
> messages.
> >
> > i've just pulled the code from the website and run it
> in
> > ecplise. i get
> > the following trace from the read sample:
> >
> > INFO: Cannot pop options off empty stack
> > PersonBean[name='James Smith',age='25']04-Aug-2005
> > 22:50:30
> > org.apache.commons.betwixt.expression.Context
> popOptions
> > INFO: Cannot pop options off empty stack
> >
> > which is right (the person bean is populated)
> >
> > for the write i get;
> >
> > <?xml version='1.0' ?>  <person>
> >     <age>21</age>
> >     <name>John Smith</name>
> >   </person>
> >
> > which is also correct.
> >
> > so, these examples work fine for me. so, i think that
> > it's probably some
> > kind of environmental or setup issue. the best thing to
> > do would be to
> > run again with logging turned up nice and high.
>
> How do i set up the logging nice and high? Not all the
> world is using commons, you know.
>
> >
> > this bit of the trace:
> >
> > Could not create instance of type:
> > org.jvnet.bindmark.CheckBetwixtPersonBean
> >
> > suggests to me that you have an issue with your
> > classpath, access
> > permissions on the bean or don't have an empty
> > constructor for the bean,
>
> This class is inner private static and has public
> constructor.
>
> Kirill
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection
> around
> http://mail.yahoo.com 
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [hidden email]
> For additional commands, e-mail:
> [hidden email]
>
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [betwixt] Sample code not working

robert burrell donkin
On Fri, 2005-08-05 at 08:34 -0700, Kirill Grouchnikov wrote:
> So, two things that finally made the code work:
>
> 1. Betwixt can not handle private static inner classes as
> beans, only public static inner classes.

betwixt uses standard java reflection to create classes. AFAIK private
inner classes cannot be created by reflection. does anyone know a trick
that does this?

> This is true even
> if the marshalling is done in the outer class which has
> immediate access to its private static class.

AIUI the code in which the call is initiated is not relevant for
security when using reflection: only the security manager.

> Is it a bug?

that depends on what you mean :)

it's certainly a limitation but not an unexpected one. i'd like to be
able to add support for private inner classes but i don't know the trick
(and won't spend much time looking at a problem that i suspect has no
solution)...

> 2. Using ByteArrayOutputStream as an underlying stream for
> BeanWriter requires closing the BeanWriter (unlike the case
> with StringWriter) to produce the XML.

have you tried calling flush or close on the beanwriter?

> Is it a bug?

probably not.

you can write more than one bean to the same stream therefore betwixt
does not flush the stream until requested. you should call close or
flush on bean write (or on the stream) when you're done.

probably this should be in the documentation, though. anyone want to
submit a patch?

> 3. Why the default configuration of BeanReader produces
> INFO messages?

good question :)

i was wondering that myself. i'm of the opinion that users should ignore
messages of INFO and below unless they are trying to diagnose a problem.
so, you should not be concerned about INFO messages. i suspect that most
of the other developers who've worked on betwixt think in a similar
fashion. i don't think that this is written down anywhere, though.

creating a logging policy then going through and ensuring that the
logging is high quality is certainly a task that needs to be done before
a betwixt 1.0 can be produce. i'll add this to the task list.

this should be pretty easy (and educational). any volunteers?

>  Why do i need to see them, and how do i
> change the log level *programatically (without property
> file)* not to see them?

betwixt uses JCL (http://jakarta.apache.org/commons/logging) which is a
thin bridging API. configuration of the log output is left entire to the
logging system bridged to. so, you need to figure which logging system
JCL is bridging to then work out whether and how you can change the
settings of that logging system programatically.

if you don't explicitly configure JCL then it will try to guess which
logging system you're using and bridge to that automatically. if have
log4j on the classpath, that'll be used otherwise if you're using java
1.4+ then java.util logging will be used. for more details, read the JCL
documentation.

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[betwixt] Time and memory performance

Kirill Grouchnikov
Hi,

You are welcome to view the time and memory performance
analysis of Betwixt at [1]. The announcement itself is
available at [2].

Regards
Kirill

[1] https://bindmark.dev.java.net/
[2] https://bindmark.dev.java.net/servlets/NewsItemView?newsItemID=2537


               
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [betwixt] Time and memory performance

robert burrell donkin
it's a shame that this analysis demonstrates so many of his personal
biases but also contains so many inaccuracies: not only in the betwixt
summary but also (i note) in several other libraries. i suppose that
there is some moral justice in that the mistakes are there for all to
read as no oppertunity was given to the team that created the library to
correct them before publication.

FWIW all libraries that use reflection must be slower than those that
generate but the introspection is the slowest part of the process. most
libraries which use reflection cache the results for performance. if you
want betwixt to perform it's necessary to use a shared
XmlBeanInfoRegistry.

- robert

On Sat, 2005-08-06 at 08:02 -0700, Kirill Grouchnikov wrote:

> Hi,
>
> You are welcome to view the time and memory performance
> analysis of Betwixt at [1]. The announcement itself is
> available at [2].
>
> Regards
> Kirill
>
> [1] https://bindmark.dev.java.net/
> [2] https://bindmark.dev.java.net/servlets/NewsItemView?newsItemID=2537
>
>
>
> ____________________________________________________
> Start your day with Yahoo! - make it your home page
> http://www.yahoo.com/r/hs 
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [betwixt] Time and memory performance

Kirill Grouchnikov
Robert,

You are more then welcome to provide the correct use of
Betwixt for optimal time and memory footprint. There are
couple of things that you should be aware of:

1. The default options should be the best ones. If i need
to tweak the settings, most of the chances are that i'll
miss it (as i did).
2. If it takes a first-time user that looks at the examples
more than 4-5 hours to make the library even work, chances
are that this user will no longer be a user.
3. BeanReader is not reusable, producing empty results
after the first unmarshaling.
4. It says in the documentation that XMLBeanInfoRegistry is
the default choice, so how do i share them and why it's not
on the first page of the documentation?

The team is (once again) more than welcome to see the
source code and to send me the corrections, which will be
incorporated, assessed and published.

The personal biases are outlined for all to see in the
project FAQ, and everyone can draw his / her own
conclusions on the weapon of choice.

Kirill

--- robert burrell donkin
<[hidden email]> wrote:

> it's a shame that this analysis demonstrates so many of
> his personal
> biases but also contains so many inaccuracies: not only
> in the betwixt
> summary but also (i note) in several other libraries. i
> suppose that
> there is some moral justice in that the mistakes are
> there for all to
> read as no oppertunity was given to the team that created
> the library to
> correct them before publication.
>
> FWIW all libraries that use reflection must be slower
> than those that
> generate but the introspection is the slowest part of the
> process. most
> libraries which use reflection cache the results for
> performance. if you
> want betwixt to perform it's necessary to use a shared
> XmlBeanInfoRegistry.
>
> - robert
>
> On Sat, 2005-08-06 at 08:02 -0700, Kirill Grouchnikov
> wrote:
> > Hi,
> >
> > You are welcome to view the time and memory performance
> > analysis of Betwixt at [1]. The announcement itself is
> > available at [2].
> >
> > Regards
> > Kirill
> >
> > [1] https://bindmark.dev.java.net/
> > [2]
>
https://bindmark.dev.java.net/servlets/NewsItemView?newsItemID=2537

> >
> >
> >
> > ____________________________________________________
> > Start your day with Yahoo! - make it your home page
> > http://www.yahoo.com/r/hs 
> >
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [hidden email]
> > For additional commands, e-mail:
> [hidden email]
> >
> >
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [hidden email]
> For additional commands, e-mail:
> [hidden email]
>
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [betwixt] Time and memory performance

robert burrell donkin
On Sat, 2005-08-06 at 10:14 -0700, Kirill Grouchnikov wrote:
> Robert,
>
> You are more then welcome to provide the correct use of
> Betwixt for optimal time and memory footprint. There are
> couple of things that you should be aware of:
>
> 1. The default options should be the best ones. If i need
> to tweak the settings, most of the chances are that i'll
> miss it (as i did).

all dynamic binders by their nature require tuning.

though your benchmarks are useful for generative binders, they not all
that informative for the dynamic binders. all dynamic binders are slow
(since they use reflection). what's crucial (for users) is whether they
can be tuned. two sets of benchmarks (vanilla and tuned) would be more
interesting and useful for the dynamic binders.

> 2. If it takes a first-time user that looks at the examples
> more than 4-5 hours to make the library even work, chances
> are that this user will no longer be a user.

i would expect most users either to follow the example as documented or
know that private static inner classes are inaccessible.

i would also not expect most users to use ByteArrayOutputStream  unless
they knew enough about it to realise the need to flush the stream.

> 3. BeanReader is not reusable, producing empty results
> after the first unmarshaling.

SAX is by it's nature single threaded. so there really isn't too much to
gain by pooling readers.

> 4. It says in the documentation that XMLBeanInfoRegistry is
> the default choice, so how do i share them and why it's not
> on the first page of the documentation?

the slowest part of the process is introspection. though bean readers
are no reusable, registries are reusable and can be shared.

> The team is (once again) more than welcome to see the
> source code and to send me the corrections, which will be
> incorporated, assessed and published.

does this include correcting the mistakes on the ease-of-use page?

not only is the betwixt entry inaccurate but i've noticed mistakes in
several others as well. IMO it's sloppy methodology not to post your
comments to the project in question first so that you have a chance to
correct your mistakes before they are made public. by labelling a
document as subjective does not excuse inaccuracies.

> The personal biases are outlined for all to see in the
> project FAQ, and everyone can draw his / her own
> conclusions on the weapon of choice.

IMO your project would be far more effective if it didn't suffer so much
from being obviously just one man's opinions. setting yourself up as a
expert without taking great care to ensure that you understand the
subject and that your criticisms are accurate is to invite attacks on
your personal integrity.

the project would also be more useful if you tried to educate users
about how to choose the most suitable binder for their problem.

you show a consistent bias against start-from-java binders in favour of
start-from-schema binders. for example, you consistently list 'Requires
writing your own classes' as a negative point but this is the whole
point of start-from-java binders! if you don't like start-from-java
binders, it would be more honest to write this at the top of the page.

this bias extends to the benchmarks as well. i would be interested to
see additional benchmarks organised to hit the start-from-java hot spot
rather than the start-from-schema one.

i also find your treatment of JAXB binders confusing. not only do you
confuse the specification with the reference implementation but
shouldn't all implementations be equally easy to use?

your ratings of the generative binders also do not seem to accord with
experience. JAXB is known to be a difficult specification to work with.
i think that most people would be very surprise to see the JAXB
implementations rated so highly in terms of ease of use. i note that you
acknowledge this in the FAQ.

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [betwixt] Time and memory performance

Kirill Grouchnikov
Robert,

> all dynamic binders by their nature require tuning.
> though your benchmarks are useful for generative binders,
> they not all
> that informative for the dynamic binders. all dynamic
> binders are slow
> (since they use reflection). what's crucial (for users)
> is whether they
> can be tuned. two sets of benchmarks (vanilla and tuned)
> would be more
> interesting and useful for the dynamic binders.

To see what exactly? That the default options of some
dynamic binder are not good? Why are they default then?

> > 2. If it takes a first-time user that looks at the
> examples
> > more than 4-5 hours to make the library even work,
> chances
> > are that this user will no longer be a user.
>
> i would expect most users either to follow the example as
> documented or
> know that private static inner classes are inaccessible.

I understand the reflection limitations, but the marshaler
goes half way (emits the attribute names, but not values,
and doesn't provide errors at all), while the unmarshaller
fails completely. It's either all go, or no go.

>
> i would also not expect most users to use
> ByteArrayOutputStream  unless
> they knew enough about it to realise the need to flush
> the stream.

Thankfully, i realised that, having worked a lot with BAOS.
However, if i need to close BeanWriter, it should be in the
docs.

> > 3. BeanReader is not reusable, producing empty results
> > after the first unmarshaling.
>
> SAX is by it's nature single threaded. so there really
> isn't too much to
> gain by pooling readers.

Is it mentioned anywhere in the docs?

>
> > 4. It says in the documentation that
> XMLBeanInfoRegistry is
> > the default choice, so how do i share them and why it's
> not
> > on the first page of the documentation?
>
> the slowest part of the process is introspection. though
> bean readers
> are no reusable, registries are reusable and can be
> shared.

Three replies later, and i still don't see an example of
doing this.

> > The team is (once again) more than welcome to see the
> > source code and to send me the corrections, which will
> be
> > incorporated, assessed and published.
>
> does this include correcting the mistakes on the
> ease-of-use page?

Currently, the following entries are on the ease-of-use
page. I don't see any mistakes there yet.

# requires writing your own classes
This can be viewed as either a negative or as a positive.
You can say that i can take all my classes and just feed
them to Betwixt with no changes. Obviously, this is not so
- the conventions for get/set pairs (for both simple and
list attributes) are pretty rigid. On the other hand, if i
start working with external system that provides its
interface description as schemas (which is a very standard
way of doing this, and believe me when i say it, because
this is where i work), i'd like to just generate those
intermediate classes from a schema without the need to
create hundreds of classes manually.

#   xml-commons jar files (resolver.jar and which.jar) have
common names which can easily lead to jar name collision
The jar naming *is* a big concern once you start to use
open source libraries *and* your own. The names should be
clear and unequivocal.

#   the marshaler needs to explicitly add xml header
Call this petty, but why should i add this by myself?


#   the marshaler and the unmarshaler require specifying
root xml tag name
Once again, may sound petty, but why should i treat root as
something different? If the an object of the same class
appears elsewhere in the hierarchy, you are not requiring
me to provide you the name, so what's different?

#   example docs use deprecated functions
(setAttributesForPrimitives, setWriteIDs, setMatchIDs)
The project examples should be *the first* to get rid of
deprecated functions. If you don't do it, what it says
about the status of deprecation?

#   can not correctly handle private static inner classes
I understand the reflection limitations, but the marshaler
goes half way (emits the attribute names, but not values,
and doesn't provide errors at all), while the unmarshaller
fails completely. It's either all go, or no go.

#   if ByteArrayOutputStream is used for marshaling, the
BeanWriter must be close()'d to see the xml, unlike
StringWriter
The documentation in its current state says nothing about
using BAOS and need to explicitly close BeanWriter. I had
to figure out this one by myself.

#   default log level for BeanReader is INFO and it
produces messages on the examples (and real code) which can
be turned off only via configuration
Now this *is* a major issue. I don't want a 3rd party to
pollute my logs, especially since everything went smoothly.
In addition, commons logging is *way* too complicated. You
can say here that it figures out everything on its own, but
there is simply no option to turn it off in every possible
system configuration except creating your own logger and
putting it on BeanReader).

> not only is the betwixt entry inaccurate but i've noticed
> mistakes in
> several others as well. IMO it's sloppy methodology not
> to post your
> comments to the project in question first so that you
> have a chance to
> correct your mistakes before they are made public. by
> labelling a
> document as subjective does not excuse inaccuracies.

Once again, i don't see mistakes. You can have your
subjective opinion, but this doesn't mean that my
subjective opinion is wrong. If you point out the
inaccuracies and i agree, they will be corrected.

> > The personal biases are outlined for all to see in the
> > project FAQ, and everyone can draw his / her own
> > conclusions on the weapon of choice.
>
> IMO your project would be far more effective if it didn't
> suffer so much
> from being obviously just one man's opinions. setting
> yourself up as a
> expert without taking great care to ensure that you
> understand the
> subject and that your criticisms are accurate is to
> invite attacks on
> your personal integrity.

No comment really.

> the project would also be more useful if you tried to
> educate users
> about how to choose the most suitable binder for their
> problem.

I think i provide enough information for the users to make
their choice.

> you show a consistent bias against start-from-java
> binders in favour of
> start-from-schema binders. for example, you consistently
> list 'Requires
> writing your own classes' as a negative point but this is
> the whole
> point of start-from-java binders! if you don't like
> start-from-java
> binders, it would be more honest to write this at the top
> of the page.

See the second last entry in FAQ on "What are the factors
that you use for "ease-of-use" scoring?" question. As a
provider of open-source *alternative* solution, you should
strive to provide a library that doesn't lock me in and
doesn't require tons of configuration files.

> this bias extends to the benchmarks as well. i would be
> interested to
> see additional benchmarks organised to hit the
> start-from-java hot spot
> rather than the start-from-schema one.

Sorry, lost me on this one. How is this biased, if the
first two places are JiBX and Javolution which are not
schema-based? Are you suggesting to manipulate results or
input sets to move more start-from-java libraries to the
top?

> i also find your treatment of JAXB binders confusing. not
> only do you
> confuse the specification with the reference
> implementation but
> shouldn't all implementations be equally easy to use?

There are only two implementations of JAXB (Sun's RI and
JaxMe), and only one implementation of JAXB 2.0 (Sun's RI).
No confusion here. All other schema-based libraries are
most definitely not JAXB binders. The question is
completely irrelevant.

> your ratings of the generative binders also do not seem
> to accord with
> experience. JAXB is known to be a difficult specification
> to work with.
> i think that most people would be very surprise to see
> the JAXB
> implementations rated so highly in terms of ease of use.
> i note that you
> acknowledge this in the FAQ.

That's what the word "subjective" means last time i checked
it in the dictionary. The FAQ clearly states why JAXB 2.0
is rated 10 out of 10. My association with JAXB 2.0 is also
clearly stated and shown to be irrelevant for the purpose
of using the library.

Kirill

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [betwixt] Time and memory performance

Kirill Grouchnikov
In reply to this post by robert burrell donkin
> IMO your project would be far more effective if it didn't
> suffer so much
> from being obviously just one man's opinions. setting
> yourself up as a
> expert without taking great care to ensure that you
> understand the
> subject and that your criticisms are accurate is to
> invite attacks on
> your personal integrity.

Another thing - the last answer in the FAQ [1] would be the
best answer to the poorly-disguised personal attack above.
Suffices to say that developers of a number of other
libraries have taken a different approach - seeing the
assessment as a chance of learning from their potential
users instead of looking down on them from high above.

Kirill

[1] https://bindmark.dev.java.net/faq.html


               
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [betwixt] Time and memory performance

robert burrell donkin
In reply to this post by Kirill Grouchnikov
On Sun, 2005-08-07 at 07:06 -0700, Kirill Grouchnikov wrote:

> Robert,
>
> > all dynamic binders by their nature require tuning.
> > though your benchmarks are useful for generative binders,
> > they not all
> > that informative for the dynamic binders. all dynamic
> > binders are slow
> > (since they use reflection). what's crucial (for users)
> > is whether they
> > can be tuned. two sets of benchmarks (vanilla and tuned)
> > would be more
> > interesting and useful for the dynamic binders.
>
> To see what exactly?

there are occasions when a dynamic binder is more useful than a
generative one. it's not good picking a dynamic binder that does not
have adequate performance when tuned.

> That the default options of some
> dynamic binder are not good? Why are they default then?

it's the nature of dynamic binding: a generator has (by definition) all
the information that they require at generation time. dynamic binders
only know what they are binding at run time. the real advantage of
dynamic binders is that they are much more flexible than generative
ones.

in the specific case of betwixt, it needs to play well with other
frameworks and so lacks

>
> > > 2. If it takes a first-time user that looks at the
> > examples
> > > more than 4-5 hours to make the library even work,
> > chances
> > > are that this user will no longer be a user.
> >
> > i would expect most users either to follow the example as
> > documented or
> > know that private static inner classes are inaccessible.
>
> I understand the reflection limitations, but the marshaler
> goes half way (emits the attribute names, but not values,
> and doesn't provide errors at all), while the unmarshaller
> fails completely. It's either all go, or no go.
>
> >
> > i would also not expect most users to use
> > ByteArrayOutputStream  unless
> > they knew enough about it to realise the need to flush
> > the stream.
>
> Thankfully, i realised that, having worked a lot with BAOS.
> However, if i need to close BeanWriter, it should be in the
> docs.
>
> > > 3. BeanReader is not reusable, producing empty results
> > > after the first unmarshaling.
> >
> > SAX is by it's nature single threaded. so there really
> > isn't too much to
> > gain by pooling readers.
>
> Is it mentioned anywhere in the docs?
>
> >
> > > 4. It says in the documentation that
> > XMLBeanInfoRegistry is
> > > the default choice, so how do i share them and why it's
> > not
> > > on the first page of the documentation?
> >
> > the slowest part of the process is introspection. though
> > bean readers
> > are no reusable, registries are reusable and can be
> > shared.
>
> Three replies later, and i still don't see an example of
> doing this.
>
> > > The team is (once again) more than welcome to see the
> > > source code and to send me the corrections, which will
> > be
> > > incorporated, assessed and published.
> >
> > does this include correcting the mistakes on the
> > ease-of-use page?
>
> Currently, the following entries are on the ease-of-use
> page. I don't see any mistakes there yet.
>
> # requires writing your own classes
> This can be viewed as either a negative or as a positive.
> You can say that i can take all my classes and just feed
> them to Betwixt with no changes. Obviously, this is not so
> - the conventions for get/set pairs (for both simple and
> list attributes) are pretty rigid. On the other hand, if i
> start working with external system that provides its
> interface description as schemas (which is a very standard
> way of doing this, and believe me when i say it, because
> this is where i work), i'd like to just generate those
> intermediate classes from a schema without the need to
> create hundreds of classes manually.
>
> #   xml-commons jar files (resolver.jar and which.jar) have
> common names which can easily lead to jar name collision
> The jar naming *is* a big concern once you start to use
> open source libraries *and* your own. The names should be
> clear and unequivocal.
>
> #   the marshaler needs to explicitly add xml header
> Call this petty, but why should i add this by myself?
>
>
> #   the marshaler and the unmarshaler require specifying
> root xml tag name
> Once again, may sound petty, but why should i treat root as
> something different? If the an object of the same class
> appears elsewhere in the hierarchy, you are not requiring
> me to provide you the name, so what's different?
>
> #   example docs use deprecated functions
> (setAttributesForPrimitives, setWriteIDs, setMatchIDs)
> The project examples should be *the first* to get rid of
> deprecated functions. If you don't do it, what it says
> about the status of deprecation?
>
> #   can not correctly handle private static inner classes
> I understand the reflection limitations, but the marshaler
> goes half way (emits the attribute names, but not values,
> and doesn't provide errors at all), while the unmarshaller
> fails completely. It's either all go, or no go.
>
> #   if ByteArrayOutputStream is used for marshaling, the
> BeanWriter must be close()'d to see the xml, unlike
> StringWriter
> The documentation in its current state says nothing about
> using BAOS and need to explicitly close BeanWriter. I had
> to figure out this one by myself.
>
> #   default log level for BeanReader is INFO and it
> produces messages on the examples (and real code) which can
> be turned off only via configuration
> Now this *is* a major issue. I don't want a 3rd party to
> pollute my logs, especially since everything went smoothly.
> In addition, commons logging is *way* too complicated. You
> can say here that it figures out everything on its own, but
> there is simply no option to turn it off in every possible
> system configuration except creating your own logger and
> putting it on BeanReader).
>
> > not only is the betwixt entry inaccurate but i've noticed
> > mistakes in
> > several others as well. IMO it's sloppy methodology not
> > to post your
> > comments to the project in question first so that you
> > have a chance to
> > correct your mistakes before they are made public. by
> > labelling a
> > document as subjective does not excuse inaccuracies.
>
> Once again, i don't see mistakes. You can have your
> subjective opinion, but this doesn't mean that my
> subjective opinion is wrong. If you point out the
> inaccuracies and i agree, they will be corrected.
>
> > > The personal biases are outlined for all to see in the
> > > project FAQ, and everyone can draw his / her own
> > > conclusions on the weapon of choice.
> >
> > IMO your project would be far more effective if it didn't
> > suffer so much
> > from being obviously just one man's opinions. setting
> > yourself up as a
> > expert without taking great care to ensure that you
> > understand the
> > subject and that your criticisms are accurate is to
> > invite attacks on
> > your personal integrity.
>
> No comment really.
>
> > the project would also be more useful if you tried to
> > educate users
> > about how to choose the most suitable binder for their
> > problem.
>
> I think i provide enough information for the users to make
> their choice.
>
> > you show a consistent bias against start-from-java
> > binders in favour of
> > start-from-schema binders. for example, you consistently
> > list 'Requires
> > writing your own classes' as a negative point but this is
> > the whole
> > point of start-from-java binders! if you don't like
> > start-from-java
> > binders, it would be more honest to write this at the top
> > of the page.
>
> See the second last entry in FAQ on "What are the factors
> that you use for "ease-of-use" scoring?" question. As a
> provider of open-source *alternative* solution, you should
> strive to provide a library that doesn't lock me in and
> doesn't require tons of configuration files.
>
> > this bias extends to the benchmarks as well. i would be
> > interested to
> > see additional benchmarks organised to hit the
> > start-from-java hot spot
> > rather than the start-from-schema one.
>
> Sorry, lost me on this one. How is this biased, if the
> first two places are JiBX and Javolution which are not
> schema-based? Are you suggesting to manipulate results or
> input sets to move more start-from-java libraries to the
> top?
>
> > i also find your treatment of JAXB binders confusing. not
> > only do you
> > confuse the specification with the reference
> > implementation but
> > shouldn't all implementations be equally easy to use?
>
> There are only two implementations of JAXB (Sun's RI and
> JaxMe), and only one implementation of JAXB 2.0 (Sun's RI).
> No confusion here. All other schema-based libraries are
> most definitely not JAXB binders. The question is
> completely irrelevant.
>
> > your ratings of the generative binders also do not seem
> > to accord with
> > experience. JAXB is known to be a difficult specification
> > to work with.
> > i think that most people would be very surprise to see
> > the JAXB
> > implementations rated so highly in terms of ease of use.
> > i note that you
> > acknowledge this in the FAQ.
>
> That's what the word "subjective" means last time i checked
> it in the dictionary. The FAQ clearly states why JAXB 2.0
> is rated 10 out of 10. My association with JAXB 2.0 is also
> clearly stated and shown to be irrelevant for the purpose
> of using the library.
>
> Kirill
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com 
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [betwixt] Time and memory performance

robert burrell donkin
In reply to this post by Kirill Grouchnikov
On Sun, 2005-08-07 at 07:12 -0700, Kirill Grouchnikov wrote:

> > IMO your project would be far more effective if it didn't
> > suffer so much
> > from being obviously just one man's opinions. setting
> > yourself up as a
> > expert without taking great care to ensure that you
> > understand the
> > subject and that your criticisms are accurate is to
> > invite attacks on
> > your personal integrity.
>
> Another thing - the last answer in the FAQ [1] would be the
> best answer to the poorly-disguised personal attack above.

it wasn't intended to be a personal attack. as i said off-list, i decide
to give you the benefit of the doubt though others may not. if you
really want to achieve the gaols you state, then i'd recommend that you
adopt a more positive attitude.

> Suffices to say that developers of a number of other
> libraries have taken a different approach - seeing the
> assessment as a chance of learning from their potential
> users instead of looking down on them from high above.

you've picked up a few things missing from the documentation. thanks for
that.

i had hoped that in return i might help to open your mind a little to
other approaches to data binding. there is a real lack of knowledge out
there about which general approaches are most appropriate to which
problems. i had hoped that you might be able to step up and but that
will mean casting aside the advocacy but maybe i've just been wasting my
time...

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [betwixt] Time and memory performance

robert burrell donkin
In reply to this post by Kirill Grouchnikov
On Sun, 2005-08-07 at 07:06 -0700, Kirill Grouchnikov wrote:
> Robert,

kirill

> #   xml-commons jar files (resolver.jar and which.jar) have
> common names which can easily lead to jar name collision
> The jar naming *is* a big concern once you start to use
> open source libraries *and* your own. The names should be
> clear and unequivocal.

this is inaccurate: betwixt ships only one jar commons-betwixt.

> #   the marshaler needs to explicitly add xml header
> Call this petty, but why should i add this by myself?

this is accurate but is a feature :)

betwixt deals with fragments not documents

> #   the marshaler and the unmarshaler require specifying
> root xml tag name

this is inaccurate. betwixt does not require specific root tags.

> Once again, may sound petty, but why should i treat root as
> something different? If the an object of the same class
> appears elsewhere in the hierarchy, you are not requiring
> me to provide you the name, so what's different?

it isn't different: dynamic binders make a guess and may have to be
corrected through configuration

> #   can not correctly handle private static inner classes

this is accurate but misleading. the java language prevents
construction. don't you feel a little silly listing that as a negative
point?

> I understand the reflection limitations, but the marshaler
> goes half way (emits the attribute names, but not values,
> and doesn't provide errors at all), while the unmarshaller
> fails completely. It's either all go, or no go.

i disagree (and i'm in good company). start-from-java binders typically
adopt a do-what-you-can approach. this is why start-from-java binders do
not guarantee to be able to round trip.

IMO it would be much more illuminating if you listed the natural
weaknesses of start-from-java binders (as you see them) separately and
then just classify those which adopt this approach.

> #   if ByteArrayOutputStream is used for marshaling, the
> BeanWriter must be close()'d to see the xml, unlike
> StringWriter
> The documentation in its current state says nothing about
> using BAOS and need to explicitly close BeanWriter. I had
> to figure out this one by myself.

inaccurate: *all* streams and readers should be closed.

> #   default log level for BeanReader is INFO

this is inaccurate. the default log level depends on your environment.

> and it
> produces messages on the examples (and real code) which can
> be turned off only via configuration
> Now this *is* a major issue. I don't want a 3rd party to
> pollute my logs, especially since everything went smoothly.
> In addition, commons logging is *way* too complicated. You
> can say here that it figures out everything on its own, but
> there is simply no option to turn it off in every possible
> system configuration except creating your own logger and
> putting it on BeanReader).

it's clear from comments about other libraries that you view the use of
JCL as a major negative point. fine. IMO it would be much clearer just
to say 'uses commons-logging' as a negative for each that does rather
than list some inaccurate specific.

i'll be interested to see whether you decide to correct the inaccuracies
in your summary listed above.

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [betwixt] Time and memory performance

Kirill Grouchnikov
Robert,

> > #   xml-commons jar files (resolver.jar and which.jar)
> have
> > common names which can easily lead to jar name
> collision
> > The jar naming *is* a big concern once you start to use
> > open source libraries *and* your own. The names should
> be
> > clear and unequivocal.
>
> this is inaccurate: betwixt ships only one jar
> commons-betwixt.

Take a look at
http://jakarta.apache.org/commons/betwixt/dependencies and
note the following line: " The following is a list of
dependencies for this project. These dependencies are
required to compile and run the application". It may be not
your fault, but once i want to use betwixt, i'm stuck with
all these jars.

>
> > #   the marshaler needs to explicitly add xml header
> > Call this petty, but why should i add this by myself?
>
> this is accurate but is a feature :)
>
> betwixt deals with fragments not documents

Ay

> > #   the marshaler and the unmarshaler require
> specifying
> > root xml tag name
>
> this is inaccurate. betwixt does not require specific
> root tags.

Taken from
http://jakarta.apache.org/commons/betwixt/guide/examples.html
:

// Write example bean as base element 'person'
beanWriter.write("person", new PersonBean("John Smith",
21));

// Register beans so that betwixt knows what the xml is to
be converted to
// Since the element mapped to a PersonBean isn't called
the same,
// need to register the path as well
beanReader.registerBeanClass("person", PersonBean.class);

> > Once again, may sound petty, but why should i treat
> root as
> > something different? If the an object of the same class
> > appears elsewhere in the hierarchy, you are not
> requiring
> > me to provide you the name, so what's different?
>
> it isn't different: dynamic binders make a guess and may
> have to be
> corrected through configuration
>
> > #   can not correctly handle private static inner
> classes
>
> this is accurate but misleading. the java language
> prevents
> construction. don't you feel a little silly listing that
> as a negative
> point?

Have you ever heard of something called setAccessible()
function on a Method and a Constructor? You don't even have
to set your own SecurityManager with checkPermission
overriden:

public static void main(String[] args) {
  try {
    Class inClazz = Class.forName("test.Test$Inner");
    Constructor ctr = inClazz.getConstructor(new Class[0]);
    ctr.setAccessible(true);
    Object instance = ctr.newInstance(new Object[0]);
    System.out.println(instance.getClass().getName());
    Method getter = inClazz.getMethod("getMember", new
Class[0]);
    getter.setAccessible(true);
    Method setter = inClazz.getMethod("setMember",
        new Class[] { int.class });
    setter.setAccessible(true);
    setter.invoke(instance, new Object[] { new Integer(27)
});
    System.out.println(getter.invoke(instance, new
Object[0]));
  } catch (Exception exc) {
    exc.printStackTrace();
  }
}

where

package test;

public class Test {
  private static class Inner {
    private int member;

    public Inner() {
    }

    public int getMember() {
      return member;
    }

    public void setMember(int member) {
      this.member = member;
    }
  }
}

If you remove setAccessible, you get access exception, but
with them (silly me), it works like magic.

> > I understand the reflection limitations, but the
> marshaler
> > goes half way (emits the attribute names, but not
> values,
> > and doesn't provide errors at all), while the
> unmarshaller
> > fails completely. It's either all go, or no go.
>
> i disagree (and i'm in good company). start-from-java
> binders typically
> adopt a do-what-you-can approach. this is why
> start-from-java binders do
> not guarantee to be able to round trip.

Except that in this case you just could go all the way
(silly me for noticing this).

> IMO it would be much more illuminating if you listed the
> natural
> weaknesses of start-from-java binders (as you see them)
> separately and
> then just classify those which adopt this approach.

How about a link from the main page at
https://bindmark.dev.java.net/ (to Ronald Bourret site)?

> > #   if ByteArrayOutputStream is used for marshaling,
> the
> > BeanWriter must be close()'d to see the xml, unlike
> > StringWriter
> > The documentation in its current state says nothing
> about
> > using BAOS and need to explicitly close BeanWriter. I
> had
> > to figure out this one by myself.
>
> inaccurate: *all* streams and readers should be closed.

Back to
http://jakarta.apache.org/commons/betwixt/guide/examples.html
and write example. Can you spot a close() for me?

>
> > #   default log level for BeanReader is INFO
>
> this is inaccurate. the default log level depends on your
> environment.

And my environment is pretty standard (it has commons
logging and JDK 5.0).

>
> > and it
> > produces messages on the examples (and real code) which
> can
> > be turned off only via configuration
> > Now this *is* a major issue. I don't want a 3rd party
> to
> > pollute my logs, especially since everything went
> smoothly.
> > In addition, commons logging is *way* too complicated.
> You
> > can say here that it figures out everything on its own,
> but
> > there is simply no option to turn it off in every
> possible
> > system configuration except creating your own logger
> and
> > putting it on BeanReader).
>
> it's clear from comments about other libraries that you
> view the use of
> JCL as a major negative point. fine. IMO it would be much
> clearer just
> to say 'uses commons-logging' as a negative for each that
> does rather
> than list some inaccurate specific.

JCK is not a major negative point as long as it *doesn't*
produce results when everything is OK. If something's up -
let me see it, if not - why should i care if some function
had empty options popped from the stack? And that C24 use
of commons logging caused OutOfMemoryError since the
logging infrastructure never released the resources (after
about 8000 marshalings).

> i'll be interested to see whether you decide to correct
> the inaccuracies
> in your summary listed above.

Am i missing something to correct (silly me)?

Kirill


               
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [betwixt] Time and memory performance

Kirill Grouchnikov
In reply to this post by robert burrell donkin
Robert,

> it wasn't intended to be a personal attack. as i said
> off-list, i decide
> to give you the benefit of the doubt though others may
> not. if you
> really want to achieve the gaols you state, then i'd
> recommend that you
> adopt a more positive attitude.

Still hadn't seen any doubts (and this discussion is
getting older every minute of it) - see my previous mails.
The attitude remains realistic.

> you've picked up a few things missing from the
> documentation. thanks for
> that.

I'd say more than a few.

> i had hoped that in return i might help to open your mind
> a little to
> other approaches to data binding. there is a real lack of
> knowledge out
> there about which general approaches are most appropriate
> to which
> problems. i had hoped that you might be able to step up
> and but that
> will mean casting aside the advocacy but maybe i've just
> been wasting my
> time...

If you really want to see an open approach to data binding
(gee, i've coded and tested twenty different libraries, i
guess i really need help opening my mind), take a look at
JAXB 2.0. Not only it generates classes from XSD / DTD /
RelaxNG schemas which can then be marshaled / unmarshaled.
It can take *any* Java class (annotated or not) and marshal
it to XML and back (i believe that's what you call a
dynamic approach). If you were looking for a single reason
why JAXB 2.0 got 10 out of 10 - this is it.

In addition, in our world of inter-systems communication,
data is king. It doesn't matter what you do with it, and in
what language, as long as you don't corrupt it or change
it.  You argue that dynamic (reflection-based) libraries
are more flexible. How about the following:
1. The format for get/set pairs is very inflexible.
2. If attribute-based approach is taken, a configuration
file must be supplied in order to omit some attributes /
classes from being marshaled. Take JXDM data (over 8.5 MB
of schemas). That would be mighty plenty of configuration
files to (manually) write and maintain.
3. What would it take to switch from Betwixt to say, JiBX
or XStream *and* maintain the data format? Conf file for
every class and attribute? That's the best scenario. The
worst - you wouldn't be able to. Welcome to schema-based
world.
4. JAXB 2.0 - generated classes can be manually edited (or
extended if you like) without changes to underlying data
format. The marshaler will simply ignore your additional
attributes.

BindMark project was not created to help people storing
20-line XML config file on a local system. Who would care
that it takes 500ms instead of 20ms if it happens only
once. I'm talking about real-world business systems that
handle thousands of XML transaction per minute and work
with external system with rigid contracts?

Data is king.

Kirill




               
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [betwixt] Time and memory performance

robert burrell donkin
In reply to this post by Kirill Grouchnikov
On Mon, 2005-08-08 at 13:43 -0700, Kirill Grouchnikov wrote:

> Robert,
>
> > > #   xml-commons jar files (resolver.jar and which.jar)
> > have
> > > common names which can easily lead to jar name
> > collision
> > > The jar naming *is* a big concern once you start to use
> > > open source libraries *and* your own. The names should
> > be
> > > clear and unequivocal.
> >
> > this is inaccurate: betwixt ships only one jar
> > commons-betwixt.
>
> Take a look at
> http://jakarta.apache.org/commons/betwixt/dependencies and
> note the following line: " The following is a list of
> dependencies for this project. These dependencies are
> required to compile and run the application". It may be not
> your fault, but once i want to use betwixt, i'm stuck with
> all these jars.

you're missing my point: resolver.jar and which.jar are not on that
list. your summary is inaccurate. if you're going to take on the role of
critique then it is important for your credibility that you make
accurate comments in your summary.

if your basic complaint is that the size of the dependency tree is a
negative: great! just say that.

you could make great improvement to the site by separating out the
advocacy and linking to it. you dislike the xml-commons stuff and think
stuff should be better named: fine. put it in a link and say some simple
and true like 'has a big dependency tree'.
 

> > > #   the marshaler and the unmarshaler require
> > specifying
> > > root xml tag name
> >
> > this is inaccurate. betwixt does not require specific
> > root tags.
>
> Taken from
> http://jakarta.apache.org/commons/betwixt/guide/examples.html
> :
>
> // Write example bean as base element 'person'
> beanWriter.write("person", new PersonBean("John Smith",
> 21));
>
> // Register beans so that betwixt knows what the xml is to
> be converted to
> // Since the element mapped to a PersonBean isn't called
> the same,
> // need to register the path as well
> beanReader.registerBeanClass("person", PersonBean.class);

this describes how the example works.

do you intend to replace your inaccurate line with something more
accurate like: poor example code (or something).

> > > Once again, may sound petty, but why should i treat
> > root as
> > > something different? If the an object of the same class
> > > appears elsewhere in the hierarchy, you are not
> > requiring
> > > me to provide you the name, so what's different?
> >
> > it isn't different: dynamic binders make a guess and may
> > have to be
> > corrected through configuration
> >
> > > #   can not correctly handle private static inner
> > classes
> >
> > this is accurate but misleading. the java language
> > prevents
> > construction. don't you feel a little silly listing that
> > as a negative
> > point?

<snip>

> If you remove setAccessible, you get access exception, but
> with them (silly me), it works like magic.

thanks for the information. i did ask you previously on the list but
you've decided to play a little game, i see! how amusing :)

> > > I understand the reflection limitations, but the
> > marshaler
> > > goes half way (emits the attribute names, but not
> > values,
> > > and doesn't provide errors at all), while the
> > unmarshaller
> > > fails completely. It's either all go, or no go.
> >
> > i disagree (and i'm in good company). start-from-java
> > binders typically
> > adopt a do-what-you-can approach. this is why
> > start-from-java binders do
> > not guarantee to be able to round trip.
>
> Except that in this case you just could go all the way
> (silly me for noticing this).

no, silly me for thinking that you might actually be engaged in honest
intelligent evaluation rather than submarine advocacy.

> > IMO it would be much more illuminating if you listed the
> > natural
> > weaknesses of start-from-java binders (as you see them)
> > separately and
> > then just classify those which adopt this approach.
>
> How about a link from the main page at
> https://bindmark.dev.java.net/ (to Ronald Bourret site)?

your site does not try to apply any classify to them, though. Ronald
seems to take a little bit of an unusual way to do it but any
classification would be better than none.

> > > #   if ByteArrayOutputStream is used for marshaling,
> > the
> > > BeanWriter must be close()'d to see the xml, unlike
> > > StringWriter
> > > The documentation in its current state says nothing
> > about
> > > using BAOS and need to explicitly close BeanWriter. I
> > had
> > > to figure out this one by myself.
> >
> > inaccurate: *all* streams and readers should be closed.
>
> Back to
> http://jakarta.apache.org/commons/betwixt/guide/examples.html
> and write example. Can you spot a close() for me?

thanks for the spot. i'll add one.
 
> > > #   default log level for BeanReader is INFO
> >
> > this is inaccurate. the default log level depends on your
> > environment.
>
> And my environment is pretty standard (it has commons
> logging and JDK 5.0).

then why not actually clarify the statement so it's true?
 

> > > and it
> > > produces messages on the examples (and real code) which
> > can
> > > be turned off only via configuration
> > > Now this *is* a major issue. I don't want a 3rd party
> > to
> > > pollute my logs, especially since everything went
> > smoothly.
> > > In addition, commons logging is *way* too complicated.
> > You
> > > can say here that it figures out everything on its own,
> > but
> > > there is simply no option to turn it off in every
> > possible
> > > system configuration except creating your own logger
> > and
> > > putting it on BeanReader).
> >
> > it's clear from comments about other libraries that you
> > view the use of
> > JCL as a major negative point. fine. IMO it would be much
> > clearer just
> > to say 'uses commons-logging' as a negative for each that
> > does rather
> > than list some inaccurate specific.
>
> JCK is not a major negative point as long as it *doesn't*
> produce results when everything is OK. If something's up -
> let me see it, if not - why should i care if some function
> had empty options popped from the stack? And that C24 use
> of commons logging caused OutOfMemoryError since the
> logging infrastructure never released the resources (after
> about 8000 marshalings).

that's my point: you don't like JCL so why not say that?

> > i'll be interested to see whether you decide to correct
> > the inaccuracies
> > in your summary listed above.
>
> Am i missing something to correct (silly me)?

yes (silly you)

the words you've chosen are inaccurate for two and could be better
chosen for a number of others. for someone who has a gift for picking
out the documentation nits from other projects, it's a shame you don't
apply the same talent to your own...

but silly me as well: i tool the hard option and wasted my time engaging
with your very stupid little games.

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [betwixt] Time and memory performance

Kirill Grouchnikov
I'm soory, but i am really tired of this fruitless dispute.
This will be my last mail on below issues.

> > Take a look at
> > http://jakarta.apache.org/commons/betwixt/dependencies
> and
> > note the following line: " The following is a list of
> > dependencies for this project. These dependencies are
> > required to compile and run the application". It may be
> not
> > your fault, but once i want to use betwixt, i'm stuck
> with
> > all these jars.
>
> you're missing my point: resolver.jar and which.jar are
> not on that
> list. your summary is inaccurate. if you're going to take
> on the role of
> critique then it is important for your credibility that
> you make
> accurate comments in your summary.

Going from
http://jakarta.apache.org/commons/betwixt/dependencies.html
to the link on xml commons and to its download section
http://xml.apache.org/mirrors.cgi . DL the
xml-commons-1.0.b2.tar.gz file. It contains three jars,
xml-apis.jar, resolver.jar and which.jar. Nowhere on
Betwixt site i've seen that i must take only xml-apis.jar.

>
> if your basic complaint is that the size of the
> dependency tree is a
> negative: great! just say that.

In "What are the factors that you use for "ease-of-use"
scoring?" section of FAQ you can see that distinct names of
jar files are part of rating. Number of jar files isn't.

>
> you could make great improvement to the site by
> separating out the
> advocacy and linking to it. you dislike the xml-commons
> stuff and think
> stuff should be better named: fine. put it in a link and
> say some simple
> and true like 'has a big dependency tree'.

Once again, nothing to do with big dependency tree. Only
with the file names.


>  
> > > > #   the marshaler and the unmarshaler require
> > > specifying
> > > > root xml tag name
> > >
> > > this is inaccurate. betwixt does not require specific
> > > root tags.
> >
> > Taken from
> >
>
http://jakarta.apache.org/commons/betwixt/guide/examples.html

> > :
> >
> > // Write example bean as base element 'person'
> > beanWriter.write("person", new PersonBean("John Smith",
> > 21));
> >
> > // Register beans so that betwixt knows what the xml is
> to
> > be converted to
> > // Since the element mapped to a PersonBean isn't
> called
> > the same,
> > // need to register the path as well
> > beanReader.registerBeanClass("person",
> PersonBean.class);
>
> this describes how the example works.
>
> do you intend to replace your inaccurate line with
> something more
> accurate like: poor example code (or something).

Once again, going to "What are the factors that you use for
"ease-of-use" scoring?" section of FAQ - "Documentation
(not Javadocs)". If you have poor documentation, you have
poor library. Period.

> > If you remove setAccessible, you get access exception,
> but
> > with them (silly me), it works like magic.
>
> thanks for the information. i did ask you previously on
> the list but
> you've decided to play a little game, i see! how amusing
> :)

The little game that caused you to call me silly. That was
amusing for a couple of minutes, you must agree.

>
> > > > I understand the reflection limitations, but the
> > > marshaler
> > > > goes half way (emits the attribute names, but not
> > > values,
> > > > and doesn't provide errors at all), while the
> > > unmarshaller
> > > > fails completely. It's either all go, or no go.
> > >
> > > i disagree (and i'm in good company). start-from-java
> > > binders typically
> > > adopt a do-what-you-can approach. this is why
> > > start-from-java binders do
> > > not guarantee to be able to round trip.
> >
> > Except that in this case you just could go all the way
> > (silly me for noticing this).
>
> no, silly me for thinking that you might actually be
> engaged in honest
> intelligent evaluation rather than submarine advocacy.

In its current state, Betwixt doesn't handle private static
inner classes correctly. This is a fact.

> > > IMO it would be much more illuminating if you listed
> the
> > > natural
> > > weaknesses of start-from-java binders (as you see
> them)
> > > separately and
> > > then just classify those which adopt this approach.
> >
> > How about a link from the main page at
> > https://bindmark.dev.java.net/ (to Ronald Bourret
> site)?
>
> your site does not try to apply any classify to them,
> though. Ronald
> seems to take a little bit of an unusual way to do it but
> any
> classification would be better than none.

The project is a benchmark, not a classificator.

>
> > > > #   if ByteArrayOutputStream is used for

> > > > #   default log level for BeanReader is INFO
> > >
> > > this is inaccurate. the default log level depends on
> your
> > > environment.
> >
> > And my environment is pretty standard (it has commons
> > logging and JDK 5.0).
>
> then why not actually clarify the statement so it's true?

So, how the "default log level for BeanReader is INFO and
it produces messages on the examples (and real code) which
can be turned off only via configuration" is not clear?

> > JCK is not a major negative point as long as it
*doesn't*
> > produce results when everything is OK. If something's
up -
> > let me see it, if not - why should i care if some
function
> > had empty options popped from the stack? And that C24
use
> > of commons logging caused OutOfMemoryError since the
> > logging infrastructure never released the resources
(after
> > about 8000 marshalings).

> that's my point: you don't like JCL so why not say that?

I suppose that JaxMe uses JCL. However, since nothing
irrelevant is printed to the console, no mention of JCL is
there. Only once it gets in the way, it is mentioned.

> > > i'll be interested to see whether you decide to
correct
> > > the inaccuracies
> > > in your summary listed above.
>
> > Am i missing something to correct (silly me)?

> yes (silly you)

> the words you've chosen are inaccurate for two and could
be better
> chosen for a number of others. for someone who has a gift
> for picking
> out the documentation nits from other projects, it's a
shame you don't
> apply the same talent to your own...

> but silly me as well: i tool the hard option and wasted
my > time
> engaging
> with your very stupid little games.

As said earlier, this is my last post, so there will be no
need to respond to the above statements, not speaking about
changing the evaluation of Betwixt (until real changes are
made to address the issues).

Kirill


               
__________________________________
Do you Yahoo!?
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

12