Amit-

Having been through the exact same issues on our project, I can say that we have found the following to be true:

1) We normally use the same form to create and modify data. The main difference with screens like this is knowing to prepopulate the velocity context with data in the modify (or field validation failure) case, so reuse of templates for creates and modifies is a good idea.

2) However, other screens that are similar generally don't benefit from reuse of the type you are talking about. My initial inclination with velocity was to try to maximize template reuse, just as one would try to maximize reuse of generic base classes. Templates, however, aren't objects and generally become unmaintainable if forced to accommodate too many invocation contexts. If you start to see #if() blocks in your velocity templates that are longer than a page in your editor, it may be time to consider splitting that template into a couple of different pieces.

One thing that we have been doing a lot more of lately is using the #parse() directive to reuse small snippets of template code.

Hope this helps.

-Brian


On Sep 2, 2004, at 9:27 AM, Amit V Shah wrote:

Hi all,

I have an application where I need web pages for like add, edit, delete some
data, which more or less represent the same data, and only have small
differences in terms of their requirements. In such case, is it better to
have a same JSP, or a Velocity Template and flag it based on the option user
selects, or is it a better idea to have different pages for each option??


I dont know if this is the right forum to ask this question so please pardon
me and disregard if this question doesnot belong in here. I just want to
have like an architectural opinion as to what would be the best practise and
what could be the considerations that I should be going through.


I prefer to having different pages for different functionalities rather than
flagging the pages, and actions and all that stuff because in my opinion
flagging only complicates things and leads to bugs which could be very
complicated to figure out, and then even worst to fix ...


Thanks,
Amit

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



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



Reply via email to