You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Vinicius Carvalho <ja...@gmail.com> on 2005/10/20 16:26:39 UTC
Creating new LinkComponents a design question
Hello there folks. I'm developing new Link Components based on the existent
ones. The main diference here is that they may or may not render, depending
on the user credentials. First I was wondering if this is already possible.
Second, if not I'm dueling with a conflict here. I've created a Base
abstract class that checks for the permissions, and returns true/false on a
canRender() method. I use this method on the renderComponent of my links.
The problem is, since Tapestry has many links components
(Direct,Extenal,Page,Generic) I was re-implementing them all. I know I could
do this using aspects in a very easy fashionable way by using around advice
on my components. But as I'm creating components to be shared using a
library, I don't want to add another layer of dependency in a AOP framework.
What you guys think would be the best approach here?
Regards
--
Vinicius Caldeira Carvalho
Arquiteto de Sistemas
vinicius.carvalho@synos.com.br
www.synos.com.br <http://www.synos.com.br>
"Everything should be made as simple as possible, but not simpler."
Albert Einstein
Re: Creating new LinkComponents a design question
Posted by Ron Piterman <rp...@gmx.net>.
Put the method which checks for permissions in a Hivemind service.
Then extend each link component with the same thing:
inject the service,
add the credential parameter,
let the hivemind service decide if super.renderComponent will be called...
just an idea...
Cheers,
ROn
ציטוט Vinicius Carvalho:
> Hello there folks. I'm developing new Link Components based on the existent
> ones. The main diference here is that they may or may not render, depending
> on the user credentials. First I was wondering if this is already possible.
> Second, if not I'm dueling with a conflict here. I've created a Base
> abstract class that checks for the permissions, and returns true/false on a
> canRender() method. I use this method on the renderComponent of my links.
> The problem is, since Tapestry has many links components
> (Direct,Extenal,Page,Generic) I was re-implementing them all. I know I could
> do this using aspects in a very easy fashionable way by using around advice
> on my components. But as I'm creating components to be shared using a
> library, I don't want to add another layer of dependency in a AOP framework.
> What you guys think would be the best approach here?
>
> Regards
>
> --
> Vinicius Caldeira Carvalho
> Arquiteto de Sistemas
> vinicius.carvalho@synos.com.br
> www.synos.com.br <http://www.synos.com.br>
>
> "Everything should be made as simple as possible, but not simpler."
> Albert Einstein
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Creating new LinkComponents a design question
Posted by Vinicius Carvalho <ja...@gmail.com>.
Thanks Ron, really cool. I'm gonna try it and I'll let you know. I the
meantime, I've done in a different way (stupid way I guess) I'm posting the
solution here anyway :D
On 10/20/05, Ron Piterman <rp...@gmx.net> wrote:
>
> If you are using java 1.5 and are willing to use annotations, each
> extending class can be *extremly* small:
> define an interface with the parameters and the injected object, and
> make every class implement this interface - every thing is there, you
> just need a two line renderComponent method...
>
> ציטוט Vinicius Carvalho:
> > Hello there folks. I'm developing new Link Components based on the
> existent
> > ones. The main diference here is that they may or may not render,
> depending
> > on the user credentials. First I was wondering if this is already
> possible.
> > Second, if not I'm dueling with a conflict here. I've created a Base
> > abstract class that checks for the permissions, and returns true/false
> on a
> > canRender() method. I use this method on the renderComponent of my
> links.
> > The problem is, since Tapestry has many links components
> > (Direct,Extenal,Page,Generic) I was re-implementing them all. I know I
> could
> > do this using aspects in a very easy fashionable way by using around
> advice
> > on my components. But as I'm creating components to be shared using a
> > library, I don't want to add another layer of dependency in a AOP
> framework.
> > What you guys think would be the best approach here?
> >
> > Regards
> >
> > --
> > Vinicius Caldeira Carvalho
> > Arquiteto de Sistemas
> > vinicius.carvalho@synos.com.br
> > www.synos.com.br <http://www.synos.com.br> <http://www.synos.com.br>
> >
> > "Everything should be made as simple as possible, but not simpler."
> > Albert Einstein
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
--
Vinicius Caldeira Carvalho
Arquiteto de Sistemas
vinicius.carvalho@synos.com.br
www.synos.com.br <http://www.synos.com.br>
"Everything should be made as simple as possible, but not simpler."
Albert Einstein
Re: Creating new LinkComponents a design question
Posted by Ron Piterman <rp...@gmx.net>.
If you are using java 1.5 and are willing to use annotations, each
extending class can be *extremly* small:
define an interface with the parameters and the injected object, and
make every class implement this interface - every thing is there, you
just need a two line renderComponent method...
ציטוט Vinicius Carvalho:
> Hello there folks. I'm developing new Link Components based on the existent
> ones. The main diference here is that they may or may not render, depending
> on the user credentials. First I was wondering if this is already possible.
> Second, if not I'm dueling with a conflict here. I've created a Base
> abstract class that checks for the permissions, and returns true/false on a
> canRender() method. I use this method on the renderComponent of my links.
> The problem is, since Tapestry has many links components
> (Direct,Extenal,Page,Generic) I was re-implementing them all. I know I could
> do this using aspects in a very easy fashionable way by using around advice
> on my components. But as I'm creating components to be shared using a
> library, I don't want to add another layer of dependency in a AOP framework.
> What you guys think would be the best approach here?
>
> Regards
>
> --
> Vinicius Caldeira Carvalho
> Arquiteto de Sistemas
> vinicius.carvalho@synos.com.br
> www.synos.com.br <http://www.synos.com.br>
>
> "Everything should be made as simple as possible, but not simpler."
> Albert Einstein
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org