aspose file tools*
The moose likes JSF and the fly likes form based application advice / design pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "form based application advice / design pattern" Watch "form based application advice / design pattern" New topic
Author

form based application advice / design pattern

niko laus
Greenhorn

Joined: Jun 23, 2010
Posts: 4
hi all

we have a application with serval form steps to collect data from a customer in a certain application in the financial surroundings.
so there is no need for a typical mvc application, because it's just collecting and validating data and log them into xml and database.
the problem is that the validation is quite complex and the visibilty of the fields are dependent form other formfields.
the next problem is that the application must be very felxible that means that f.e. a field could be moved to another step of the application, new fields must be easily integrated etc...

so my problem is that i couldn't find any pattern or framework that support this kind of application.

if i have a look to frameworks and validation concepts in jav - to tell the truth - it makes me a bit scary about flexibilty ,maintainability aside of typing my fingertips bloody.

so is there any concept / desgin pattern or framework that supports this aspect.
and the validation and data concept must be reused by a webservice!

i could imagine the application with jsf but without a typical managed bean buit a kind of formhandler or the help of other - more dynamical - languages like jruby.

thank you for your adivce...

regards
niko


Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15661
    
  15

Yes, there's a design paradigm geared towards inputting, validating and storing data. It's called MVC.

JSF isn't really that hard for the most part. In fact, it's so easy that an incredibly large number of people seem to feel obligated to develop overly-complex ways of doing things in JSF, perhaps because they don't believe that it can really be that simple.

In the case of basic data input/editing, JSF supports 2 levels of validation. Basic syntactic validation can be done by the JSF framework using specifications such as validator elements on input controls and built-in validations attributes such as 'required="true"'. Semantic validation such as cross-field checking is a little harder. Sometimes it can be done with listener methods, but often the easiest thing to do is do the semantic validation in an action processor that bounces back the edit screen with error messages until all the semantic conditions are met.


Customer surveys are for companies who didn't pay proper attention to begin with.
Eric Ford
Greenhorn

Joined: Jun 04, 2010
Posts: 17
there is no need for a typical mvc application


I find it odd that you would make that assertion and then follow it up with:

the application must be very felxible that means that f.e. a field could be moved to another step of the application, new fields must be easily integrated etc...


Using MVC doesn't guarantee maintainability or extensibility but not using it can often have the opposite effect.

I recommend you take a long look at Facelets templating. And, possibly, RichFaces for building your pages. Couple those with a well thought-out overall design.

I, personally, haven't done much in the way of web services but I suspect the JSF validation isn't going to be of much use to you there. You'll need server-side validation within the web-service components themselves rather than in the JSF ViewHandler which likely would not be invoked for web-service calls.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: form based application advice / design pattern
 
Similar Threads
Validator Framework
Validating some extra fields of action form not in my jsp?
[Rails] Validation in Model rather than Controller
Multi Form Validation
html:file tag