You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Amit V Shah <as...@tagaudit.com> on 2004/09/02 18:27:02 UTC

Duplicating Pages

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: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Duplicating Pages

Posted by Brian Lawler <br...@tribenetwork.com>.
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: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Duplicating Pages

Posted by David Demner <tu...@demner.com>.
Hi Amit,

I took the same approach - different pages for different functionalities.
However, all pages use the same action to add/edit/delete the data since the
code was so simliar.

It's worked out pretty well so far.  Obviously, the only pain is when I
think of a better way to do something and then I have to go through all the
pages to change it.  But I'm pretty happy with it now so I don't need to do
this very often.

You can also look at the sample application at http://zebra.tigris.org to
see how they did it.

Good luck,

David

-----Original Message-----
From: Amit V Shah [mailto:ashah@tagaudit.com] 
Sent: Thursday September 2, 2004 9:27 AM
To: 'turbine-user@jakarta.apache.org'
Subject: Duplicating Pages


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: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org