On 10/3/06, moraleslos <[EMAIL PROTECTED]> wrote:
I dabbled with JAXB 2 as you suggested. JAXB 2 looks good but the issue is
it generates many classes that won't get persisted. This is not the fault
of JAXB, its just due to the nature of the XML we get (we don't need a lot
of the data). Instead, I was thinking about using a tool like Castor to
populate our domain-specific bean from the XML.
Or you could just add JAXB 2 annotations to your domain-specific bean
then you don't have to do any code generation and only the domain
objects will get persisted and will appear nicely in an XSD?
If I do it this way, how
will servicemix fit into the scheme of things?
As Guillaume said, ServiceMix can work either way - whether using
bean first or schema first, ServiceMix can work with the XML or the
POJOs and has things like JSR 181 support for doing the marshalling
etc.
Also suppose that I do use JAXB 2 w/ hyperjaxb (the schema-first
suggestion). I don't understand where JSR 181 fits into all of this. Isn't
this used for Web Services? I thought I would be using an FTP/polling
mechanism to retrieve the XML... not sure how JSR 181 is used to make the
retrieval of the XML file work.
Its just a component that does the marshalling of XML to POJOs via JAXB2.
One thing to consider is if you want to turn your 'data objects' into
some kind of service API & WSDL.
e.g. if you create a bunch of services to accept, say, PurchaseOrders
and persist them or to look them up using primary/foreign keys - you
might want to create WSDL so folks can reuse the services from other
applications.
It might be a good idea if we had a way to take some JAXB POJOs and
auto-create a WSDL so we create a kinda 'Data Access Object' WSDL /
interface.
e.g. for a PurchaseOrder we might create some CRUD service to match it
like this...
public interface PurchaseOrderService {
PurchaseOrder find(Integer primaryKey);
Integer insert(PurchaseOrder data);
void update(PurchaseOrder data);
void delete(Integer primaryKey);
// some foreign key queries etc
List<PurchaseOrder> findByFoo(String textQuery);
}
--
James
-------
http://radio.weblogs.com/0112098/