You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Eric Everman <ev...@precedadesign.com> on 2003/02/27 19:33:53 UTC

Accessing Extensions - Too buried?

Hi-

To access an extension within a component, code like this is required:

==================
MyExtension me;
me =
(MyExtension)
(getPage().getRequestCycle().getEngine().getSpecification().getExtension("MyExtName"));
==================


Could the getExtension() method be surfaced a bit more in the API to 
simplify access?  Am I missing a shortcut?


Eric Everman

Preceda Design LLC
www.precedadesign.com


RE: Accessing Extensions - Too buried?

Posted by "Howard M. Lewis Ship" <hl...@attbi.com>.
Yes, they are very deeply buried.

We *could* make them easier to access, but that would clutter an already
very-cluttered API further.  

Possible solutions:
Create a base class from BasePage that has additional methods to access
extensions.
Create a static utility class that has static methods to access extensions.
Create an engine subclass that exposes the extensions as JavaBean
properties.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/proposals/tapestry



> -----Original Message-----
> From: Eric Everman [mailto:everman@precedadesign.com] 
> Sent: Thursday, February 27, 2003 1:34 PM
> To: tapestry-dev@jakarta.apache.org
> Subject: Accessing Extensions - Too buried?
> 
> 
> Hi-
> 
> To access an extension within a component, code like this is required:
> 
> ==================
> MyExtension me;
> me =
> (MyExtension) 
> (getPage().getRequestCycle().getEngine().getSpecification().ge
> tExtension("MyExtName"));
> ==================
> 
> 
> Could the getExtension() method be surfaced a bit more in the API to 
> simplify access?  Am I missing a shortcut?
> 
> 
> Eric Everman
> 
> Preceda Design LLC
> www.precedadesign.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>