You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ken nashua <nh...@hotmail.com> on 2006/10/30 15:20:51 UTC

Tapestry UI Ques... common base classes usage ok?

Hi Folks,

Given the array of options of doing things... I am annotation biased and 
prefer to define a base class that all my pages use that performs things via 
annotation if possible.

1. I wonder what a base class would do to interfere with tapestry's core 
processing though especially with regard to any reflection it performs under 
the hood. Is it generally dangerous to implement a base class that performs 
common operations (ex. provide get methods for getHomePage() or 
getLoginPage(), getLogger(), getRole(), getUser() etc...)

I am just trying to minimize the amount of code in my java classes.

If anyone could elaborate on this topic that would be terrific.

Thanks

_________________________________________________________________
Find a local pizza place, music store, museum and more…then map the best 
route!  http://local.live.com?FORM=MGA001


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry UI Ques... common base classes usage ok?

Posted by "B.S.Navin" <bs...@effigent.net>.
Hi Ken,

You can use a base class. Just make your base class extend BasePage.

In my project too, we use a custom base class, which does exactly  
what you described - abstract common code out. Using such a class,  
also helps when you may need to add some hooks into your processing  
(as many calls to pages) may be routed through your base class.

- Navin

On 30-Oct-06, at 7:50 PM, Ken nashua wrote:

> Hi Folks,
>
> Given the array of options of doing things... I am annotation  
> biased and prefer to define a base class that all my pages use that  
> performs things via annotation if possible.
>
> 1. I wonder what a base class would do to interfere with tapestry's  
> core processing though especially with regard to any reflection it  
> performs under the hood. Is it generally dangerous to implement a  
> base class that performs common operations (ex. provide get methods  
> for getHomePage() or getLoginPage(), getLogger(), getRole(), getUser 
> () etc...)
>
> I am just trying to minimize the amount of code in my java classes.
>
> If anyone could elaborate on this topic that would be terrific.
>
> Thanks
>
> _________________________________________________________________
> Find a local pizza place, music store, museum and more
> then map the best route!  http://local.live.com?FORM=MGA001
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry UI Ques... common base classes usage ok?

Posted by Jesse Kuhnert <jk...@gmail.com>.
It's not dangerous or "bad" to add these things to a base class, though the
"new and cool" way people are doing these things is by injecting hivemind
services on an "as needed" basis.

On 10/30/06, Ken nashua <nh...@hotmail.com> wrote:
>
> Hi Folks,
>
> Given the array of options of doing things... I am annotation biased and
> prefer to define a base class that all my pages use that performs things
> via
> annotation if possible.
>
> 1. I wonder what a base class would do to interfere with tapestry's core
> processing though especially with regard to any reflection it performs
> under
> the hood. Is it generally dangerous to implement a base class that
> performs
> common operations (ex. provide get methods for getHomePage() or
> getLoginPage(), getLogger(), getRole(), getUser() etc...)
>
> I am just trying to minimize the amount of code in my java classes.
>
> If anyone could elaborate on this topic that would be terrific.
>
> Thanks
>
> _________________________________________________________________
> Find a local pizza place, music store, museum and more…then map the best
> route!  http://local.live.com?FORM=MGA001
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo/(and a dash of TestNG), team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com