Mike,

I agree about pretty much everything you said and am afraid that I will 
need to develop this as well as my app has lots of model objects.

Would you be willing to share the code you developed to extend the 
validation?

Also it might be great to create a JIRA ticket and attach the code for 
consideration for integration i.e. so that the Stripes default 
validation provider is available alongside your more sophisticated 
validation provider OOB and developers could run with one over the other.

I agree that this is an area of weakness and when one uses JPA you want 
to take advantage of those annotations as much as possible otherwise its 
a maintenance nightmare.  Your thoughts?

Cheers,

--Nikolaos



Mike McNally wrote:
> Actually I feel that the basic Stripes mechanisms for annotating 
> validation information to be completely inadequate for an application 
> of any serious complexity. Inevitably, persisted objects will be 
> manipulated by many actions, and the consequent need to repeat the 
> validation rules over and over again introduces grave maintenance 
> problems.
>
> Thankfully, Stripes is easy to extend, so I (and, I have no doubt, 
> many others) extended the validation mechanism as almost the very 
> first thing I did with the framework. Specifically what I did was 
> replace the default ValidationMetadataProvider so that it follows 
> properties and "imports" metadata from their classes. That way, my 
> low-level JPA-annotated data objects can include some amount of 
> validation metadata, such as field lengths and converter settings. The 
> business logic is then (usually) where "required" annotations go. All 
> that wraps up to the action bean layer, and since metadata is cached 
> at the action bean level it all works out - two different action beans 
> referencing the same business logic bean each have their own "mix-in" 
> of metadata, and I don't have to repeat validation rules (at least, 
> not very often).
>
> It's still not perfect: EL validation isn't really possible because 
> the only thing Stripes can bind into the EL context is the action bean 
> reference, so EL validation rules from a lower layer can't really work 
> because they can't find themselves, so to speak. However I've found 
> that it's pretty rare that I need anything that fancy anyway; 
> validation is generally either really simple stuff, or else it's 
> full-blown code that requires a lot of context.
>
> On Fri, Sep 10, 2010 at 6:40 AM, Richard Hauswald 
> <richard.hausw...@googlemail.com 
> <mailto:richard.hausw...@googlemail.com>> wrote:
>
>     Hi,
>     what about creating a Pojo holding all the form variables und
>     referencing it in the actionBean and doing validation using
>     @ValidateNestedProperties?
>     Regards,
>     Richard
>
>     On Fri, Sep 10, 2010 at 12:52 PM, andres <ispanand...@yahoo.es
>     <mailto:ispanand...@yahoo.es>> wrote:
>
>
>         What is the best way to separate variabls in a larger form the
>         action? In Struts 1 you have a separate action (for the logic)
>         and form (to use for fields). In Stripes have all this in
>         action. Hope I explained well.
>
>         I thought to create a class NameModel with a variabls for a
>         form and extend it of BaseActionBean and then extend my
>         NombreActionBean class of NameModel  to separate variables
>         (form fields) from ActionBean and can access to them. And use
>         only for the logic NombreActionBean.
>
>         Do you know the better way to do it? After picking up the form
>         fields NameModel would have to pass them to DAO object to
>         store in DB.
>
>         Thank you.
>         Greetings.
>
>
>
>         
> ------------------------------------------------------------------------------
>         Automate Storage Tiering Simply
>         Optimize IT performance and efficiency through flexible, powerful,
>         automated storage tiering capabilities. View this brief to
>         learn how
>         you can reduce costs and improve performance.
>         http://p.sf.net/sfu/dell-sfdev2dev
>         _______________________________________________
>         Stripes-users mailing list
>         Stripes-users@lists.sourceforge.net
>         <mailto:Stripes-users@lists.sourceforge.net>
>         https://lists.sourceforge.net/lists/listinfo/stripes-users
>
>
>
>
>     -- 
>     Richard Hauswald
>     Blog: http://tnfstacc.blogspot.com/
>     LinkedIn: http://www.linkedin.com/in/richardhauswald
>     Xing: http://www.xing.com/profile/Richard_Hauswald
>
>     
> ------------------------------------------------------------------------------
>     Automate Storage Tiering Simply
>     Optimize IT performance and efficiency through flexible, powerful,
>     automated storage tiering capabilities. View this brief to learn how
>     you can reduce costs and improve performance.
>     http://p.sf.net/sfu/dell-sfdev2dev
>     _______________________________________________
>     Stripes-users mailing list
>     Stripes-users@lists.sourceforge.net
>     <mailto:Stripes-users@lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/stripes-users
>
>
>
>
> -- 
> Turtle, turtle, on the ground,
> Pink and shiny, turn around.
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Automate Storage Tiering Simply
> Optimize IT performance and efficiency through flexible, powerful, 
> automated storage tiering capabilities. View this brief to learn how
> you can reduce costs and improve performance. 
> http://p.sf.net/sfu/dell-sfdev2dev
> ------------------------------------------------------------------------
>
> _______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>   


-- 
Nikolaos Giannopoulos
Director, BrightMinds Software Inc.
e. nikol...@brightminds.org
w. www.brightminds.org
t. 1.613.822.1700
c. 1.613.797.0036
f. 1.613.822.1915


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to