Re: Converting Model Data to View

2005-02-21 Thread brenmcguire
You have to use some J2EE design patterns to achieve this:
http://java.sun.com/blueprints/patterns/catalog.html
1) Put all of your business logic in a Business Delegate, i.e. the code
that accesses to XML files (I am supposing that you know everything about
XML manipulation, otherwise it will be off topic...). The signature of the
methods must not depend on particular technologies, i.e. you should not
use some Servlet-specific or Struts-specific parameters in signatures, and
you should not put any reference in the signature of the fact that you are
storing data in an XML file.
2) Suppose that you call an action. First of al you have to extract the
data from the ActionForm and put it in:
a) simple objects, such as ints, floats, strings, arrays, etc.
b) if your data is particularly complex, use the Transfer Object (or Value
Object, they are synonyms) design pattern and transfer each property of
the ActionForm to this transfer object.
These simple objects or transfer objects will be the parameters of methods
of the business delegate.
Notice that these patterns can be used independently from the technology,
so you can use it almost always.
BTW, Business Delegates are in the "Model" side of MVC.
Ciao
Antonio Petrelli

Tushar Agrawal wrote:

>Hi Folks,
>
>I am using Struts1.1, Tiles and Validator framework. In my application
>user enters data into a portlet and that data gets stored as comma
>seperated values. While retreveing we tokenize and displayed it in View
JSPs.
>
>I want to store this data in some structured format (Such as XML). Could
>you please tell me some of the best practices for doing this.
>
>Thnaks & Regards
>Tushar
>



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Converting Model Data to View

2005-02-20 Thread Tushar Agrawal
Hi Folks,
 
I am using Struts1.1, Tiles and Validator framework. In my application 
user enters data into a portlet and that data gets stored as comma 
seperated values. While retreveing we tokenize and displayed it in View JSPs. 
 
I want to store this data in some structured format (Such as XML). Could 
you please tell me some of the best practices for doing this. 
 
Thnaks & Regards
Tushar


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com