users@jersey.java.net

Re: [Jersey] How To ? POST to Generated Resources with 1-N relationship ????

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Mon, 22 Jun 2009 14:48:49 -0700

2009/6/22 Sébastien Stormacq <Sebastien.Stormacq_at_sun.com>:
> Craig,
>
> I agree that starting with a sound schema is certainly the best approach.
> I choose to start from the DB, then generate everything from the Entity up
> to REST web service because it looked like the fastest approach in my
> context : prototyping.

I don't think there is anything wrong in starting from a convenient
place -- I'm not sure using XML Schema would necessarily even be the
optimal way for your use case. Schema is most useful when definitions
(but not implementations, like annotated java classes) have to be
shared with external entities.

I think this is one of the thing I like not only about JAX-RS but also
about JAXB: you can do both schema-first and code-first development;
as well as combinations, like bootstrapping with schema-first
approach, and then proceeding with code-based development. And if need
be, re-generate schema from annotations... sort of iterative
development, especially during prototyping.

So I think there is no need to change model thinking there is always
just one true model, that's all. :)

-+ Tatu +-