You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Yoav Abrahami <yo...@gmail.com> on 2009/10/12 15:12:15 UTC

Suggestion to integrate J2XB into CXF

Hi all,
I have been seeing the XFire and CXF projects mature of the last few years
and really like the approach. Great work guys.

J2XB is an open source for Data Binding with some novel ideas.
I have been running for some time trying to prove a point - that you can
define a complete service interface in Java using only Java code and
annotations.
A Service interface includes the WSDL generation including XML Schema
generation with full facets supports, inheritance, customized structure
mapping, etc.
In addition, it has novel support for model classes which do not have
default constructors and require the use of complex constructors or
factories.

The J2XB site is at http://j2xb.sourceforge.net/

I am currently thinking about returning to the J2XB project to add
additional novel ideas for adding comments and documentation to the
generated WSDL and for complete interfaces inheritance support, as well as
thoughts about enabling a second mapping configuration alternative as XML
instead of annotations.


I am basically asking you guys two questions
1. Is there an interest in integrating J2XB 1.1 as it is now with Apache
CFX?
2. Is there an interest in continuing the work of the J2XB project either as
joining it or as taking the ideas (including the ones I am thinking of for
J2XB 2.0) to existing frameworks in CFX?

Cheers,
  Yoav

Re: Suggestion to integrate J2XB into CXF

Posted by Daniel Kulp <dk...@apache.org>.
On Wed October 14 2009 6:04:19 am Yoav Abrahami wrote:
> As for integrating - J2XB currently uses an abstraction of the actual XML
> parser with current implementation for Axiom. Having another implementation
> over Stax is simple to do and actually something I am thinking of for
> reasons of performance (Stax is about 6 times faster compared to Axiom,
>  from my experience).
> 
> The same goes for XMLSchema generation - simple to have it in
> org.apache.XmlSchema objects.
> 
> If I am to build this integration, will you be willing to help with the CFX
> knowhow? (what are the integration points, how to configure CFX to use
>  J2XB, etc).

Yea.   I'd be fine with helping out.   It can easily be done either in CXF or 
in your code base.   CXF supports pluggable data bindings (we have some for 
JAXB, XMLBeans, SDO, Aegis, Source, Stax, etc..) so it could be a plugin that 
is download from your site or part of CXF, etc...

One "slight" issue will be to support this for the normal unwrapping modes, 
we'll probably need to abstract out the creation of the wrapper type from the 
JAXWS front end and stick it in to the databinding API somehow.   Right now, 
that stuff is more or less hardcoded for JAXB and to produce JAXB things.  Not 
a huge deal though.   Something that probably should be done anyway. 

Dan

 
> I think the main question is if there is need, if the ideas that J2XB
>  brings are interesting to the CFX community. J2XB itself has about 500
>  downloads over the last year, most are using it with the Axis 2
>  integration to generate XML Schema with facets. 500 may seem like a small
>  number, however, it does indicate need and considering there is no
>  promotion of the library at all.. (it is not listed in the Axis site)
> 
> Cheers,
>   Yoav
> 
> 
> <http://j2xb.sourceforge.net/Constructors%20and%20Factories.html>
> 
> On Mon, Oct 12, 2009 at 7:02 PM, Daniel Kulp <dk...@apache.org> wrote:
> > On Mon October 12 2009 9:12:15 am Yoav Abrahami wrote:
> > > Hi all,
> > > I have been seeing the XFire and CXF projects mature of the last few
> >
> > years
> >
> > > and really like the approach. Great work guys.
> > >
> > > J2XB is an open source for Data Binding with some novel ideas.
> > > I have been running for some time trying to prove a point - that you
> > > can define a complete service interface in Java using only Java code
> > > and annotations.
> >
> > JAXB + JAX-WS already allows this.   :-)   We've been trying to prove the
> > same
> > point for quite some time.   :-)
> >
> > > A Service interface includes the WSDL generation including XML Schema
> > > generation with full facets supports, inheritance, customized structure
> > > mapping, etc.
> >
> > Again, JAXB + JAX-WS, although we can also do so with Aegis.
> >
> > > In addition, it has novel support for model classes which do not have
> > > default constructors and require the use of complex constructors or
> > > factories.
> >
> > Now that starts getting interesting.
> >
> > > The J2XB site is at http://j2xb.sourceforge.net/
> > >
> > > I am currently thinking about returning to the J2XB project to add
> > > additional novel ideas for adding comments and documentation to the
> > > generated WSDL and for complete interfaces inheritance support, as well
> >
> > as
> >
> > > thoughts about enabling a second mapping configuration alternative as
> > > XML instead of annotations.
> > >
> > >
> > > I am basically asking you guys two questions
> > > 1. Is there an interest in integrating J2XB 1.1 as it is now with
> > > Apache CFX?
> >
> > Well, I haven't seen any demand for it from CXF users specifically, but
> > it may
> > be valuable, possibly for J2XB users.   Having never followed J2XB at
> > all, I'm
> > not sure how valuable it would be to them.
> >
> > The main issue, looking at the javadoc API's, is that it seems to be
> > fairly "file based" and not really stream based, and definitely
> > preferrable Stax based.   That definitely will make it MUCH harder to
> > integrate into CXF. CXF pretty much uses Stax
> > (XMLStreamWriter/XMLStreamReader) things for pretty
> > much all interaction with the databinding layer.   If the databinding
> > supports
> > that, it's usually not hard to integrate into CXF.
> >
> > You could look at the XMLBeans databinding as an example:
> >
> >
> > http://svn.apache.org/repos/asf//cxf/trunk/rt/databinding/xmlbeans/src/ma
> >in/java/org/apache/cxf/xmlbeans/ or the SDO databinging:
> >
> > http://svn.apache.org/repos/asf//cxf/trunk/rt/databinding/sdo/src/main/ja
> >va/org/apache/cxf/sdo
> >
> > Particularly the DataWriterImpls and DataReaderImpls.
> >
> >
> > Likewise, for generating the Schemas to stick in the generated wsdl, we
> > would
> > need to generate into either:
> > 1) DOMs
> > 2) Stax (which we would then go to DOM)
> > 3) org.apache XmlSchema schema objects (eventually, the DOM's from above
> > go into this)
> >
> > > 2. Is there an interest in continuing the work of the J2XB project
> > > either as joining it or as taking the ideas (including the ones I am
> > > thinking
> >
> > of
> >
> > >  for J2XB 2.0) to existing frameworks in CFX?
> >
> > Having never heard of J2XB before, I really have no idea.  :-)
> >
> >
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://www.dankulp.com/blog
> 

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: Suggestion to integrate J2XB into CXF

Posted by Yoav Abrahami <yo...@gmail.com>.
Hi Daniel,
Thanks for the long answer.

As for JAXB - my understanding and my brief experience with JAXB 2 was that
is does supports features such as substitution groups and a lot of other
interesting features at the price of constraining how to write the Java
code.

For instance, I can take the Union example. To my understanding, in JAXB 2,
the generated XML schema does not include a union simple type - you need to
modify the generated XML schema manually (see the article at
http://weblogs.java.net/blog/kohsuke/archive/2006/03/handling_union.html).
J2XB solves the same problem using declarative annotations including full
XML Schema generation (see the section 'Atomic Inheritance and XML Union'
at http://j2xb.sourceforge.net/inheritence.html)

As for the support for factories and constructors, a detailed explanation is
at http://j2xb.sourceforge.net/Constructors%20and%20Factories.html


As for integrating - J2XB currently uses an abstraction of the actual XML
parser with current implementation for Axiom. Having another implementation
over Stax is simple to do and actually something I am thinking of for
reasons of performance (Stax is about 6 times faster compared to Axiom, from
my experience).

The same goes for XMLSchema generation - simple to have it in
org.apache.XmlSchema objects.

If I am to build this integration, will you be willing to help with the CFX
knowhow? (what are the integration points, how to configure CFX to use J2XB,
etc).


I think the main question is if there is need, if the ideas that J2XB brings
are interesting to the CFX community. J2XB itself has about 500 downloads
over the last year, most are using it with the Axis 2 integration to
generate XML Schema with facets. 500 may seem like a small number, however,
it does indicate need and considering there is no promotion of the library
at all.. (it is not listed in the Axis site)

Cheers,
  Yoav


<http://j2xb.sourceforge.net/Constructors%20and%20Factories.html>

On Mon, Oct 12, 2009 at 7:02 PM, Daniel Kulp <dk...@apache.org> wrote:

> On Mon October 12 2009 9:12:15 am Yoav Abrahami wrote:
> > Hi all,
> > I have been seeing the XFire and CXF projects mature of the last few
> years
> > and really like the approach. Great work guys.
> >
> > J2XB is an open source for Data Binding with some novel ideas.
> > I have been running for some time trying to prove a point - that you can
> > define a complete service interface in Java using only Java code and
> > annotations.
>
> JAXB + JAX-WS already allows this.   :-)   We've been trying to prove the
> same
> point for quite some time.   :-)
>
>
> > A Service interface includes the WSDL generation including XML Schema
> > generation with full facets supports, inheritance, customized structure
> > mapping, etc.
>
> Again, JAXB + JAX-WS, although we can also do so with Aegis.
>
> > In addition, it has novel support for model classes which do not have
> > default constructors and require the use of complex constructors or
> > factories.
>
> Now that starts getting interesting.
>
> >
> > The J2XB site is at http://j2xb.sourceforge.net/
> >
> > I am currently thinking about returning to the J2XB project to add
> > additional novel ideas for adding comments and documentation to the
> > generated WSDL and for complete interfaces inheritance support, as well
> as
> > thoughts about enabling a second mapping configuration alternative as XML
> > instead of annotations.
> >
> >
> > I am basically asking you guys two questions
> > 1. Is there an interest in integrating J2XB 1.1 as it is now with Apache
> > CFX?
>
> Well, I haven't seen any demand for it from CXF users specifically, but it
> may
> be valuable, possibly for J2XB users.   Having never followed J2XB at all,
> I'm
> not sure how valuable it would be to them.
>
> The main issue, looking at the javadoc API's, is that it seems to be fairly
> "file based" and not really stream based, and definitely preferrable Stax
> based.   That definitely will make it MUCH harder to integrate into CXF.
> CXF pretty much uses Stax (XMLStreamWriter/XMLStreamReader) things for
> pretty
> much all interaction with the databinding layer.   If the databinding
> supports
> that, it's usually not hard to integrate into CXF.
>
> You could look at the XMLBeans databinding as an example:
>
>
> http://svn.apache.org/repos/asf//cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/
> or the SDO databinging:
>
> http://svn.apache.org/repos/asf//cxf/trunk/rt/databinding/sdo/src/main/java/org/apache/cxf/sdo
>
> Particularly the DataWriterImpls and DataReaderImpls.
>
>
> Likewise, for generating the Schemas to stick in the generated wsdl, we
> would
> need to generate into either:
> 1) DOMs
> 2) Stax (which we would then go to DOM)
> 3) org.apache XmlSchema schema objects (eventually, the DOM's from above go
> into this)
>
>
> > 2. Is there an interest in continuing the work of the J2XB project either
> >  as joining it or as taking the ideas (including the ones I am thinking
> of
> >  for J2XB 2.0) to existing frameworks in CFX?
>
> Having never heard of J2XB before, I really have no idea.  :-)
>
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>

Re: Suggestion to integrate J2XB into CXF

Posted by Yoav Abrahami <yo...@gmail.com>.
Hay Richard,
I have looked at you project and it shows some nice ideas, specifically the
option of using properties file to define the mapping in addition to the
annotations. If I may, I think that a little more examples in the site will
help a lot.

As for J2XB compared to X2JB - except for the similar name and the the fact
that both libraries are about XML binding, they are quite different and aim
to solve different problems. J2XB is about a very flexible binding in terms
of structure transformations and in terms of XML Schema generation.

To my knowledge, J2XB is the most advanced library today in terms of XML
Schema features. It aims to support most, if not all, of the different XML
Schema validations and constraints when generating the XML Schema. Today it
supports facets, substitution groups and more.

You are most welcome to take ideas from J2XB to incorporate into X2JB or
even join the project.

Cheers,
  Yoav


On Tue, Oct 13, 2009 at 9:11 AM, Richard Opalka <ro...@redhat.com> wrote:

> On first sight I thought it's about my free time project.
> Then I noticed the diff ;)
>
> http://j2xb.sourceforge.net/
> vs.
> http://x2jb.sourceforge.net/
>
> Richard
>
>
> On 10/12/2009 07:02 PM, Daniel Kulp wrote:
>
>> On Mon October 12 2009 9:12:15 am Yoav Abrahami wrote:
>>
>>> Hi all,
>>> I have been seeing the XFire and CXF projects mature of the last few
>>> years
>>> and really like the approach. Great work guys.
>>>
>>> J2XB is an open source for Data Binding with some novel ideas.
>>> I have been running for some time trying to prove a point - that you can
>>> define a complete service interface in Java using only Java code and
>>> annotations.
>>>
>>
>> JAXB + JAX-WS already allows this.   :-)   We've been trying to prove the
>> same
>> point for quite some time.   :-)
>>
>>
>>  A Service interface includes the WSDL generation including XML Schema
>>> generation with full facets supports, inheritance, customized structure
>>> mapping, etc.
>>>
>>
>> Again, JAXB + JAX-WS, although we can also do so with Aegis.
>>
>>  In addition, it has novel support for model classes which do not have
>>> default constructors and require the use of complex constructors or
>>> factories.
>>>
>>
>> Now that starts getting interesting.
>>
>>
>>> The J2XB site is at http://j2xb.sourceforge.net/
>>>
>>> I am currently thinking about returning to the J2XB project to add
>>> additional novel ideas for adding comments and documentation to the
>>> generated WSDL and for complete interfaces inheritance support, as well
>>> as
>>> thoughts about enabling a second mapping configuration alternative as XML
>>> instead of annotations.
>>>
>>>
>>> I am basically asking you guys two questions
>>> 1. Is there an interest in integrating J2XB 1.1 as it is now with Apache
>>> CFX?
>>>
>>
>> Well, I haven't seen any demand for it from CXF users specifically, but it
>> may
>> be valuable, possibly for J2XB users.   Having never followed J2XB at all,
>> I'm
>> not sure how valuable it would be to them.
>>
>> The main issue, looking at the javadoc API's, is that it seems to be
>> fairly
>> "file based" and not really stream based, and definitely preferrable Stax
>> based.   That definitely will make it MUCH harder to integrate into CXF.
>> CXF pretty much uses Stax (XMLStreamWriter/XMLStreamReader) things for
>> pretty
>> much all interaction with the databinding layer.   If the databinding
>> supports
>> that, it's usually not hard to integrate into CXF.
>>
>> You could look at the XMLBeans databinding as an example:
>>
>>
>> http://svn.apache.org/repos/asf//cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/
>> or the SDO databinging:
>>
>> http://svn.apache.org/repos/asf//cxf/trunk/rt/databinding/sdo/src/main/java/org/apache/cxf/sdo
>>
>> Particularly the DataWriterImpls and DataReaderImpls.
>>
>>
>> Likewise, for generating the Schemas to stick in the generated wsdl, we
>> would
>> need to generate into either:
>> 1) DOMs
>> 2) Stax (which we would then go to DOM)
>> 3) org.apache XmlSchema schema objects (eventually, the DOM's from above
>> go
>> into this)
>>
>>
>>  2. Is there an interest in continuing the work of the J2XB project either
>>>  as joining it or as taking the ideas (including the ones I am thinking
>>> of
>>>  for J2XB 2.0) to existing frameworks in CFX?
>>>
>>
>> Having never heard of J2XB before, I really have no idea.  :-)
>>
>>
>>
> --
> Richard Opalka
> JBoss Software Engineer
>
> Mail: ropalka@redhat.com
> Mobile: +420731186942
>

Re: Suggestion to integrate J2XB into CXF

Posted by Richard Opalka <ro...@redhat.com>.
On first sight I thought it's about my free time project.
Then I noticed the diff ;)

http://j2xb.sourceforge.net/
vs.
http://x2jb.sourceforge.net/

Richard

On 10/12/2009 07:02 PM, Daniel Kulp wrote:
> On Mon October 12 2009 9:12:15 am Yoav Abrahami wrote:
>> Hi all,
>> I have been seeing the XFire and CXF projects mature of the last few years
>> and really like the approach. Great work guys.
>>
>> J2XB is an open source for Data Binding with some novel ideas.
>> I have been running for some time trying to prove a point - that you can
>> define a complete service interface in Java using only Java code and
>> annotations.
>
> JAXB + JAX-WS already allows this.   :-)   We've been trying to prove the same
> point for quite some time.   :-)
>
>
>> A Service interface includes the WSDL generation including XML Schema
>> generation with full facets supports, inheritance, customized structure
>> mapping, etc.
>
> Again, JAXB + JAX-WS, although we can also do so with Aegis.
>
>> In addition, it has novel support for model classes which do not have
>> default constructors and require the use of complex constructors or
>> factories.
>
> Now that starts getting interesting.
>
>>
>> The J2XB site is at http://j2xb.sourceforge.net/
>>
>> I am currently thinking about returning to the J2XB project to add
>> additional novel ideas for adding comments and documentation to the
>> generated WSDL and for complete interfaces inheritance support, as well as
>> thoughts about enabling a second mapping configuration alternative as XML
>> instead of annotations.
>>
>>
>> I am basically asking you guys two questions
>> 1. Is there an interest in integrating J2XB 1.1 as it is now with Apache
>> CFX?
>
> Well, I haven't seen any demand for it from CXF users specifically, but it may
> be valuable, possibly for J2XB users.   Having never followed J2XB at all, I'm
> not sure how valuable it would be to them.
>
> The main issue, looking at the javadoc API's, is that it seems to be fairly
> "file based" and not really stream based, and definitely preferrable Stax
> based.   That definitely will make it MUCH harder to integrate into CXF.
> CXF pretty much uses Stax (XMLStreamWriter/XMLStreamReader) things for pretty
> much all interaction with the databinding layer.   If the databinding supports
> that, it's usually not hard to integrate into CXF.
>
> You could look at the XMLBeans databinding as an example:
>
> http://svn.apache.org/repos/asf//cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/
> or the SDO databinging:
> http://svn.apache.org/repos/asf//cxf/trunk/rt/databinding/sdo/src/main/java/org/apache/cxf/sdo
>
> Particularly the DataWriterImpls and DataReaderImpls.
>
>
> Likewise, for generating the Schemas to stick in the generated wsdl, we would
> need to generate into either:
> 1) DOMs
> 2) Stax (which we would then go to DOM)
> 3) org.apache XmlSchema schema objects (eventually, the DOM's from above go
> into this)
>
>
>> 2. Is there an interest in continuing the work of the J2XB project either
>>   as joining it or as taking the ideas (including the ones I am thinking of
>>   for J2XB 2.0) to existing frameworks in CFX?
>
> Having never heard of J2XB before, I really have no idea.  :-)
>
>

-- 
Richard Opalka
JBoss Software Engineer

Mail: ropalka@redhat.com
Mobile: +420731186942

Re: Suggestion to integrate J2XB into CXF

Posted by Daniel Kulp <dk...@apache.org>.
On Mon October 12 2009 9:12:15 am Yoav Abrahami wrote:
> Hi all,
> I have been seeing the XFire and CXF projects mature of the last few years
> and really like the approach. Great work guys.
> 
> J2XB is an open source for Data Binding with some novel ideas.
> I have been running for some time trying to prove a point - that you can
> define a complete service interface in Java using only Java code and
> annotations.

JAXB + JAX-WS already allows this.   :-)   We've been trying to prove the same 
point for quite some time.   :-)


> A Service interface includes the WSDL generation including XML Schema
> generation with full facets supports, inheritance, customized structure
> mapping, etc.

Again, JAXB + JAX-WS, although we can also do so with Aegis.

> In addition, it has novel support for model classes which do not have
> default constructors and require the use of complex constructors or
> factories.

Now that starts getting interesting.

> 
> The J2XB site is at http://j2xb.sourceforge.net/
> 
> I am currently thinking about returning to the J2XB project to add
> additional novel ideas for adding comments and documentation to the
> generated WSDL and for complete interfaces inheritance support, as well as
> thoughts about enabling a second mapping configuration alternative as XML
> instead of annotations.
> 
> 
> I am basically asking you guys two questions
> 1. Is there an interest in integrating J2XB 1.1 as it is now with Apache
> CFX?

Well, I haven't seen any demand for it from CXF users specifically, but it may 
be valuable, possibly for J2XB users.   Having never followed J2XB at all, I'm 
not sure how valuable it would be to them.  

The main issue, looking at the javadoc API's, is that it seems to be fairly 
"file based" and not really stream based, and definitely preferrable Stax 
based.   That definitely will make it MUCH harder to integrate into CXF.    
CXF pretty much uses Stax (XMLStreamWriter/XMLStreamReader) things for pretty 
much all interaction with the databinding layer.   If the databinding supports 
that, it's usually not hard to integrate into CXF.    

You could look at the XMLBeans databinding as an example: 

http://svn.apache.org/repos/asf//cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/
or the SDO databinging:
http://svn.apache.org/repos/asf//cxf/trunk/rt/databinding/sdo/src/main/java/org/apache/cxf/sdo

Particularly the DataWriterImpls and DataReaderImpls.


Likewise, for generating the Schemas to stick in the generated wsdl, we would 
need to generate into either:
1) DOMs
2) Stax (which we would then go to DOM)
3) org.apache XmlSchema schema objects (eventually, the DOM's from above go 
into this)


> 2. Is there an interest in continuing the work of the J2XB project either
>  as joining it or as taking the ideas (including the ones I am thinking of
>  for J2XB 2.0) to existing frameworks in CFX? 

Having never heard of J2XB before, I really have no idea.  :-)


-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog