You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chris Chiappone <ch...@gmail.com> on 2005/08/06 00:19:17 UTC

Component Abuse

I'm curious if I am abusing the use of components in my application. 
I pretty much create a component for any block of html that I believe
I will reuse at some point in another page.  I realize these
components will only be used in my application.  And they are directly
tied to the pages that contain them.  Is this considered bad form? 
And if so what is the best way to reuse this information.

-- 
~chris

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


Re: Component Abuse

Posted by Howard Lewis Ship <hl...@gmail.com>.
Pages are pooled, components are not (that is, they are pooled within
pages).  A big difference from JSP, where individual tags are pooled
(costly!).

I think 4.0's infrastructure will support a much higher degree of
complexity than 3.0; it is more efficient at moving data around and
caching it in that there's a lot less reflection going on than in 3.0
(even regardless of OGNL).

Components == good.


On 8/5/05, Darío Vasconcelos <da...@gmail.com> wrote:
> As far as I understand, the page rendering is always done on-the-fly,
> that is, there is a component pool and when some page needs one, the
> pool quickly provides it. Now, thinking what Chris originally asked,
> is there too much overhead if I have a page with, say, 20 components?
> Or 50? If a page has deeply nested components and many many variables
> to bind (doing it both in the rewinding and the processing phases),
> Tapestry of course would be a much better option over JSPs or similar,
> but is there an inflexion point where one would be indeed abusing the
> concept?
> 
> 
> PS. Proof-reading my own post I realize this is kind of a silly
> question, since such a complex page should never exist and would be a
> problem not only for any framework but also for any user... :-)
> 
> 
> On 8/5/05, Kevin Menard <km...@servprise.com> wrote:
> > On Friday 05 August 2005 19:13, Robert Zeigler wrote:
> >
> > > My point was simply that, just because you can't reuse the component
> > > across multiple projects doesn't mean it shouldn't be a component. :)
> > > (Or, there's nothing wrong with application-specific components. :)
> >
> > Ahh good, then we're in agreement :-)
> >
> > --
> > Kevin
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> 
> 
> --
> Hay dos tipos de mujeres: las bonitas y las que se pintan. - Enrique
> Jardiel Poncela
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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


Re: Component Abuse

Posted by Robert Zeigler <ro...@scazdl.org>.
Hm... interesting... I had a different understanding of the pooling
process... though I could be wrong. :) My understanding is that only the
pages are pooled. The page spec, and all component specs contained
therein, are parsed once and cached.  The page instance, and all
contained components, are created once; once a component instance is
created, it is always associated with the same page instance, even after
the page is returned to the pool.  In which case, most of the overhead
you mention is avoided (except in the initial caching process).  I think
the only thing that you'd be looking at in terms of additional overhead
is the binding process... not sure how much overhead that adds, though.
Someone with more intimate knowledge of the process want to comment here?

Robert

Darío Vasconcelos wrote:
> As far as I understand, the page rendering is always done on-the-fly,
> that is, there is a component pool and when some page needs one, the
> pool quickly provides it. Now, thinking what Chris originally asked,
> is there too much overhead if I have a page with, say, 20 components?
> Or 50? If a page has deeply nested components and many many variables
> to bind (doing it both in the rewinding and the processing phases),
> Tapestry of course would be a much better option over JSPs or similar,
> but is there an inflexion point where one would be indeed abusing the
> concept?
> 
> 
> PS. Proof-reading my own post I realize this is kind of a silly
> question, since such a complex page should never exist and would be a
> problem not only for any framework but also for any user... :-)
> 
> 
> On 8/5/05, Kevin Menard <km...@servprise.com> wrote:
> 
>>On Friday 05 August 2005 19:13, Robert Zeigler wrote:
>>
>>
>>>My point was simply that, just because you can't reuse the component
>>>across multiple projects doesn't mean it shouldn't be a component. :)
>>>(Or, there's nothing wrong with application-specific components. :)
>>
>>Ahh good, then we're in agreement :-)
>>
>>--
>>Kevin
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
> 
> 
> 


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


Re: Component Abuse

Posted by Darío Vasconcelos <da...@gmail.com>.
As far as I understand, the page rendering is always done on-the-fly,
that is, there is a component pool and when some page needs one, the
pool quickly provides it. Now, thinking what Chris originally asked,
is there too much overhead if I have a page with, say, 20 components?
Or 50? If a page has deeply nested components and many many variables
to bind (doing it both in the rewinding and the processing phases),
Tapestry of course would be a much better option over JSPs or similar,
but is there an inflexion point where one would be indeed abusing the
concept?


PS. Proof-reading my own post I realize this is kind of a silly
question, since such a complex page should never exist and would be a
problem not only for any framework but also for any user... :-)


On 8/5/05, Kevin Menard <km...@servprise.com> wrote:
> On Friday 05 August 2005 19:13, Robert Zeigler wrote:
> 
> > My point was simply that, just because you can't reuse the component
> > across multiple projects doesn't mean it shouldn't be a component. :)
> > (Or, there's nothing wrong with application-specific components. :)
> 
> Ahh good, then we're in agreement :-)
> 
> --
> Kevin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


-- 
Hay dos tipos de mujeres: las bonitas y las que se pintan. - Enrique
Jardiel Poncela

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


Re: Component Abuse

Posted by Kevin Menard <km...@servprise.com>.
On Friday 05 August 2005 19:13, Robert Zeigler wrote:

> My point was simply that, just because you can't reuse the component
> across multiple projects doesn't mean it shouldn't be a component. :)
> (Or, there's nothing wrong with application-specific components. :)

Ahh good, then we're in agreement :-)

-- 
Kevin

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


Re: Component Abuse

Posted by Robert Zeigler <ro...@scazdl.org>.

Kevin Menard wrote:
> On Friday 05 August 2005 18:38, Robert Zeigler wrote:
> 
>>Personal opinion, but i don't find that bad form in any way. Quite the
>>opposite.  Basically... if you're thinking about your templates like
>>they are objects, and the html like it's java code, and you don't want
>>to rewrite it, then, imo, you're on the right track.
>>Treat the html like code... object and methods (ie components) = reuse,
>>less typing, and less debugging! :) I'd go so far as to say that if
>>you're /not/ creating components, even application specific ones, you're
>>really not taking full advantage of everything tapestry has to offer.
> 
> 
> On the same token, components for the sake of components really doesn't gain 
> you anything.

Agreed.

> 
> Personally, I go for the easiest, most straightforward approach first (i.e., 
> no component) and then when I actually encounter something that would merit 
> code reuse, I refactor into a component.  I find this far easier to manage 
> since I don't have a ton of JWC files kicking around that are essentially 
> gaining me nothing.  But then again, I really got hooked on the agile 
> software method's idea of "code for now, wait for the future" approach.
> 

In all honesty, that's typically what I do.
I write it into the page.
And if I'm working on another page, and find myself writing something
which looks suspiciously familiar, or find myself needing functionality
I know I already wrote into another page, I'll go back and turn it into
a component.
My point was simply that, just because you can't reuse the component
across multiple projects doesn't mean it shouldn't be a component. :)
(Or, there's nothing wrong with application-specific components. :)

Robert

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


Re: Component Abuse

Posted by Kevin Menard <km...@servprise.com>.
On Friday 05 August 2005 18:38, Robert Zeigler wrote:
> Personal opinion, but i don't find that bad form in any way. Quite the
> opposite.  Basically... if you're thinking about your templates like
> they are objects, and the html like it's java code, and you don't want
> to rewrite it, then, imo, you're on the right track.
> Treat the html like code... object and methods (ie components) = reuse,
> less typing, and less debugging! :) I'd go so far as to say that if
> you're /not/ creating components, even application specific ones, you're
> really not taking full advantage of everything tapestry has to offer.

On the same token, components for the sake of components really doesn't gain 
you anything.

Personally, I go for the easiest, most straightforward approach first (i.e., 
no component) and then when I actually encounter something that would merit 
code reuse, I refactor into a component.  I find this far easier to manage 
since I don't have a ton of JWC files kicking around that are essentially 
gaining me nothing.  But then again, I really got hooked on the agile 
software method's idea of "code for now, wait for the future" approach.

-- 
Kevin

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


RE: Component Abuse

Posted by Patrick Casey <pa...@adelphia.net>.
	I'm with Robert on this one. Most of the time making a true,
perfectly decoupled component that solves a general case problem is way more
trouble than it's worth. If I can do 10% of the work and get a component
that works in the special case of my application, I'll go home happy.

	--- Pat

> -----Original Message-----
> From: Robert Zeigler [mailto:robertz@scazdl.org]
> Sent: Friday, August 05, 2005 3:38 PM
> To: Tapestry users
> Subject: Re: Component Abuse
> 
> Personal opinion, but i don't find that bad form in any way. Quite the
> opposite.  Basically... if you're thinking about your templates like
> they are objects, and the html like it's java code, and you don't want
> to rewrite it, then, imo, you're on the right track.
> Treat the html like code... object and methods (ie components) = reuse,
> less typing, and less debugging! :) I'd go so far as to say that if
> you're /not/ creating components, even application specific ones, you're
> really not taking full advantage of everything tapestry has to offer.
> 
> Robert Zeigler
> 
> Chris Chiappone wrote:
> > I'm curious if I am abusing the use of components in my application.
> > I pretty much create a component for any block of html that I believe
> > I will reuse at some point in another page.  I realize these
> > components will only be used in my application.  And they are directly
> > tied to the pages that contain them.  Is this considered bad form?
> > And if so what is the best way to reuse this information.
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



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


Re: Component Abuse

Posted by Robert Zeigler <ro...@scazdl.org>.
Personal opinion, but i don't find that bad form in any way. Quite the
opposite.  Basically... if you're thinking about your templates like
they are objects, and the html like it's java code, and you don't want
to rewrite it, then, imo, you're on the right track.
Treat the html like code... object and methods (ie components) = reuse,
less typing, and less debugging! :) I'd go so far as to say that if
you're /not/ creating components, even application specific ones, you're
really not taking full advantage of everything tapestry has to offer.

Robert Zeigler

Chris Chiappone wrote:
> I'm curious if I am abusing the use of components in my application. 
> I pretty much create a component for any block of html that I believe
> I will reuse at some point in another page.  I realize these
> components will only be used in my application.  And they are directly
> tied to the pages that contain them.  Is this considered bad form? 
> And if so what is the best way to reuse this information.
> 


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