On Mon, Jan 17, 2011 at 3:24 AM, Dennis Sosnoski <d...@sosnoski.com> wrote:

>  I'd planned to support annotations for schema constraints at some point,
> and it shouldn't be a huge job to add them in. It would involve changes to
> the actual code generation, though, and could not be handled by simple
> extensions.
>
> I'm not sure that JSR-303 is my preferred implementation, either. As I
> understand it, it's based on using a Validator to check for constraint
> violations. That seems fundamentally flawed to me, I'd much rather see
> constraints enforced at the time values are set (immediate fail). If a value
> is supposed to be non-null, why should a set method support setting a null
> value? So although it would be nice to support generating JSR-303
> annotations, I'd prefer to generate smart set methods that forbid violating
> a constraint.
>

I think these are two different problems. The first thing you mention is
some kind of Java annotations which would translate into additional XSD
information during the JiBX Java -> XSD generation step. This makes sense as
a nice feature to have in JiBX that would allow the developer to tighten up
the generated XSD.

However, JSR 303 annotations are solving a different, much more general
problem and are not really an appropriate technology to adopt for that
purpose. JSR 303 annotations can check things that are not expressible in
XSD. If you tried this, you would be stuck with only being able to translate
those few, simple annotations that can be directly translated.

-Archie

-- 
Archie L. Cobbs
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to