You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Dan Wells <da...@byu.edu> on 2003/07/24 00:47:28 UTC
8 big questions
Hi all,
I just started looking into Tapestry a couple of weeks ago, and have
been trying to learn it, while still working on other non-related
projects. As I have been reading documentation, looking at example
apps, and writing my own basic apps, I have come up with some
questions.
My apologies in advance for the length of this email, and for asking any
obvious questions. I do hope this is not an abuse of the mail list.
First off also, let me say I'm really impressed with Tapestry!
1. Just to clarify the conceptual and functional differences between a
parameter and a property (persistent, transient, whatever): Could it be
said that a parameter IS a property, but a property IS NOT necessarily a
parameter? Pages can have properties, but not parameters. Components
have both. So a parameter is a property set by a containing component,
while a property is the more general idea of a property of a java
object. Right?
2. What exactly is an informal parameter? Where/what are some examples?
Would an example be <span jwcid="component"
listener="path.to.myListener" />, where the listener attribute is an
informal parameter because it is not specified in the page
specification?
3. What are the issues with using XHTML, or XML & XSLT? Is there a way
for Tapestry to output XML with XSLT for the templates of the
components? Would I have to write my own engine service for that? Why
isn't there a way to specify in the specification the file name and type
for the template (it seems to me this should be a must)?
4. In the localization section of the developer's guide, it mentions
that Tapestry allows multiple versions of templates and assets. So how
is this done? Does the template HAVE to have the same root name as the
jwc file or can I name it whatever? And where do I specify which
template I want the component to use? Is this only used for
localization? I think the template should not be so highly coupled to
the component, especially when you already have an xml specification
that is supposed to remove the coupling of the java and the template.
5. Why can't I place my reusable component somewhere else in the
classpath and still use it? The documentation seems to say you can, but
I haven't got it working yet. Does it have to be a private asset and
defined as such in the application specification? Or am I just not
configuring correctly?
6. Without reading each of the items in the ''What's New'' section (
though I did skim them a bit), what are the major changes in version 3.0
that make the Developer's guide so out-dated?
7. Docs said that page objects are pooled to increase performance since
the templates and specs are interpreted at run time. So I guess the page
java objects are pooled, so only a few instances are instantiated so as
to overcome overhead of creating an object for each hit, and the
templates and specs are interpreted at each hit. So what exactly is
happening when the docs say the pages are cached? Is this referring to
the pooling? I don't think so, therefore I've got to be missing
something.
8. Please send me a list of websites and applications, including URLs
if possible, who are using Tapestry (preferrably 3.0, and please specify
the version in use) in mission critical production systems. I have been
really impressed with Tapestry, and would like some extra "ammo" with
which to sell the Tapestry idea to our management. If you could also
provide some more detail on testing results with high-load,
transactional applications, that would really help. I would appreciate
this type of information a great deal.
--
Dan Wells <da...@byu.edu>
Re: 8 big questions
Posted by Luis Neves <ln...@netcabo.pt>.
Hi,
On Wednesday 23 July 2003 23:47, Dan Wells wrote:
> 1. Just to clarify the conceptual and functional differences between a
> parameter and a property (persistent, transient, whatever): Could it be
> said that a parameter IS a property, but a property IS NOT necessarily a
> parameter? Pages can have properties, but not parameters. Components
> have both. So a parameter is a property set by a containing component,
> while a property is the more general idea of a property of a java
> object. Right?
Some time ago I asked that question myself, you can view the thread in the
mailing list archives:
http://article.gmane.org/gmane.comp.java.tapestry.user/1914
Please read MindBridge response:
http://article.gmane.org/gmane.comp.java.tapestry.user/1915
> 2. What exactly is an informal parameter? Where/what are some examples?
> Would an example be <span jwcid="component"
> listener="path.to.myListener" />, where the listener attribute is an
> informal parameter because it is not specified in the page
> specification?
An informal parameter is every HTML attribute that you can put at element that
isn't a part of the component specification.
> 3. What are the issues with using XHTML, or XML & XSLT? Is there a way
> for Tapestry to output XML with XSLT for the templates of the
> components? Would I have to write my own engine service for that? Why
> isn't there a way to specify in the specification the file name and type
> for the template (it seems to me this should be a must)?
I think that is possible for you do that.
You can pretty much output whatever markup you want, you just have to write
the appropriate IMarkupWriter, see the WAP components to have an idea on how
to do that.
> 4. In the localization section of the developer's guide, it mentions
> that Tapestry allows multiple versions of templates and assets. So how
> is this done?
You just have to append the "country code" to the name of the template/assest.
> Does the template HAVE to have the same root name as the
> jwc file or can I name it whatever?
They must have the same name.
> And where do I specify which
> template I want the component to use?
You don't. You give it the same name and Tapestry will find it... provided
that it is in the search path.
> Is this only used for
> localization? I think the template should not be so highly coupled to
> the component, especially when you already have an xml specification
> that is supposed to remove the coupling of the java and the template.
This seems to be a common request lately... in particular for people that want
to have "skinning" capabilities for their application
> 5. Why can't I place my reusable component somewhere else in the
> classpath and still use it? The documentation seems to say you can, but
> I haven't got it working yet. Does it have to be a private asset and
> defined as such in the application specification? Or am I just not
> configuring correctly?
Without you giving more information it's hard to tell.
What is your project structure? And where in that structure are you putting
the components?
I will try to answer your other questions tomorrow (if no else does).
Regards,
Luis Neves
RE: 8 big questions
Posted by Dan Wells <da...@byu.edu>.
Thanks Howard and Luis!
On Thu, 2003-07-24 at 05:44, Howard M. Lewis Ship wrote:
> > -----Original Message-----
> > From: dvw3@email.byu.edu [mailto:dvw3@email.byu.edu] On
> > Behalf Of Dan Wells
> > Sent: Wednesday, July 23, 2003 6:47 PM
> > To: tapestry-user@jakarta.apache.org
> > Subject: 8 big questions
> >
> >
> > Hi all,
> >
> > I just started looking into Tapestry a couple of weeks ago,
> > and have been trying to learn it, while still working on
> > other non-related projects. As I have been reading
> > documentation, looking at example apps, and writing my own
> > basic apps, I have come up with some questions.
> >
> > My apologies in advance for the length of this email, and for
> > asking any obvious questions. I do hope this is not an abuse
> > of the mail list.
> > First off also, let me say I'm really impressed with Tapestry!
> >
> > 1. Just to clarify the conceptual and functional differences
> > between a parameter and a property (persistent, transient,
> > whatever): Could it be said that a parameter IS a property,
> > but a property IS NOT necessarily a parameter? Pages can have
> > properties, but not parameters. Components have both. So a
> > parameter is a property set by a containing component, while
> > a property is the more general idea of a property of a java
> > object. Right?
>
> Pages and components have properties. Some of those properties may be persistent ... they may
> persist from one request cycle to another (ultimately, the value is stored in the HttpSession).
>
> Component may have parameters; in general, component parameters are represented as additional
> properties.
>
>
> >
> > 2. What exactly is an informal parameter? Where/what are some
> > examples?
> > Would an example be <span jwcid="component"
> > listener="path.to.myListener" />, where the listener
> > attribute is an informal parameter because it is not
> > specified in the page specification?
>
> Every component has an explicit set of formal parameters; for each formal parameter you will declare
> a name, a type, whether it is required or optional.
>
> However, the majority of components in Tapestry map 1:1 to an HTML element. If you are used to JSP
> tags, you know how painful it is when the JSP tag author forgot to provide a way to set a particular
> HTML attribute, such as "class" (for integrating with CSS), or any of the Javascript event handler
> attribute.
>
> In Tapestry, a component may accept informal parameters. These are additional parameters beyond the
> formally defined parameters. The component can insert the informal parameters as additional HTML
> attributes. Informal paramaters may be literal strings, expressions or localized messages.
> Example:
>
> <img jwcid="@Image" image="ognl:assets.logo"
> width="250" height="100"
> alt="message:logo-title"
> class="ognl:logoClass"/>
>
> This will be an Image component. The href for the Image is set from the formal image parameter (to
> an asset).
> The remaining four attributes are informal parameters. The first two are literal. "alt" is set
> from a localized message in the page's messages file.
> The final attribute, "class", is take from the method getLogoClass() on the page [*].
>
> [*] For simplicit, I usually talk about a simple hierarchy where a page contains components.
> However, components can contain other components and you should
> substitute "container" for "page".
>
>
> >
> > 3. What are the issues with using XHTML, or XML & XSLT? Is
> > there a way for Tapestry to output XML with XSLT for the
> > templates of the components? Would I have to write my own
> > engine service for that? Why isn't there a way to specify in
> > the specification the file name and type for the template (it
> > seems to me this should be a must)?
>
> There simply hasn't been a call for this functionality. It's entirely possible using new services.
>
>
>
> >
> > 4. In the localization section of the developer's guide, it
> > mentions that Tapestry allows multiple versions of templates
> > and assets. So how is this done? Does the template HAVE to
> > have the same root name as the jwc file or can I name it
> > whatever? And where do I specify which template I want the
> > component to use? Is this only used for localization? I think
> > the template should not be so highly coupled to the
> > component, especially when you already have an xml
> > specification that is supposed to remove the coupling of the
> > java and the template.
>
> No, it's the same approach taken with assets. So you can have Home.html, Home_fr.html and
> Home_de.html.
>
> >
> > 5. Why can't I place my reusable component somewhere else in
> > the classpath and still use it? The documentation seems to
> > say you can, but I haven't got it working yet. Does it have
> > to be a private asset and defined as such in the application
> > specification? Or am I just not configuring correctly?
>
> I'm not sure I follow you. If a component is used only in your application, then you can place its
> component specification (.jwc) file in WEB-INF, along with its HTML template (if it has one). It's
> code is part of your application and should end up in WEB-INF/classes.
>
> If you component is reusable across applications, you should package it into a component library and
> distribute it as a JAR.
>
> A private asset is a way such a component can still provide assets (such as images and stylesheets)
> even though it is inside a JAR. The framework takes care of either exporting the asset to the
> filesystem or serving up the content as a bytestream (depending on how you have Tapestry
> configured).
>
>
> >
> > 6. Without reading each of the items in the ''What's New''
> > section ( though I did skim them a bit), what are the major
> > changes in version 3.0 that make the Developer's guide so out-dated?
>
> Version 3.0 adds a *lot*, but the important parts are:
>
> 1) Implicit components in HTML templates
> 2) Can put specs in WEB-INF and templates in context
> 3) Can omit most specifications (including app spec)
> 4) <property-specification> element in page and component spec (along with all the class enhancement
> stuff)
> 5) Improved handling of component parameters (generally, more class enhancement)
>
>
> >
> > 7. Docs said that page objects are pooled to increase
> > performance since the templates and specs are interpreted at
> > run time. So I guess the page java objects are pooled, so
> > only a few instances are instantiated so as to overcome
> > overhead of creating an object for each hit, and the
> > templates and specs are interpreted at each hit. So what
> > exactly is happening when the docs say the pages are cached?
> > Is this referring to the pooling? I don't think so, therefore
> > I've got to be missing something.
>
> A pooled page includes the page instance, all components, all bindings, all templates, etc.
> Tapestry is very efficient at rendering once the page is fully constructed.
>
> When a new page is instantiated, its still relatively efficient: the templates will already have
> been located and parsed, as will the specifications. However, there's still quite a bit of
> instantiating of objects and assigning of properties to do.
>
> Parsing a template involves reading the template, finding all the components and other stuff and
> turning it into a list of tokens. In additionk there's a whole threading process involved in
> assigning each template token to the right component's body.
>
>
> >
> > 8. Please send me a list of websites and applications,
> > including URLs if possible, who are using Tapestry
> > (preferrably 3.0, and please specify the version in use) in
> > mission critical production systems. I have been really
> > impressed with Tapestry, and would like some extra "ammo"
> > with which to sell the Tapestry idea to our management. If
> > you could also provide some more detail on testing results
> > with high-load, transactional applications, that would really
> > help. I would appreciate this type of information a great deal.
> >
>
> That I can't help directly with, but there are several out there that I know of (Joel?).
>
> >
> > --
> > Dan Wells <da...@byu.edu>
> >
> >
> > ---------------------------------------------------------------------
> > 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
--
Dan Wells <da...@byu.edu>
RE: 8 big questions
Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
> -----Original Message-----
> From: dvw3@email.byu.edu [mailto:dvw3@email.byu.edu] On
> Behalf Of Dan Wells
> Sent: Wednesday, July 23, 2003 6:47 PM
> To: tapestry-user@jakarta.apache.org
> Subject: 8 big questions
>
>
> Hi all,
>
> I just started looking into Tapestry a couple of weeks ago,
> and have been trying to learn it, while still working on
> other non-related projects. As I have been reading
> documentation, looking at example apps, and writing my own
> basic apps, I have come up with some questions.
>
> My apologies in advance for the length of this email, and for
> asking any obvious questions. I do hope this is not an abuse
> of the mail list.
> First off also, let me say I'm really impressed with Tapestry!
>
> 1. Just to clarify the conceptual and functional differences
> between a parameter and a property (persistent, transient,
> whatever): Could it be said that a parameter IS a property,
> but a property IS NOT necessarily a parameter? Pages can have
> properties, but not parameters. Components have both. So a
> parameter is a property set by a containing component, while
> a property is the more general idea of a property of a java
> object. Right?
Pages and components have properties. Some of those properties may be persistent ... they may
persist from one request cycle to another (ultimately, the value is stored in the HttpSession).
Component may have parameters; in general, component parameters are represented as additional
properties.
>
> 2. What exactly is an informal parameter? Where/what are some
> examples?
> Would an example be <span jwcid="component"
> listener="path.to.myListener" />, where the listener
> attribute is an informal parameter because it is not
> specified in the page specification?
Every component has an explicit set of formal parameters; for each formal parameter you will declare
a name, a type, whether it is required or optional.
However, the majority of components in Tapestry map 1:1 to an HTML element. If you are used to JSP
tags, you know how painful it is when the JSP tag author forgot to provide a way to set a particular
HTML attribute, such as "class" (for integrating with CSS), or any of the Javascript event handler
attribute.
In Tapestry, a component may accept informal parameters. These are additional parameters beyond the
formally defined parameters. The component can insert the informal parameters as additional HTML
attributes. Informal paramaters may be literal strings, expressions or localized messages.
Example:
<img jwcid="@Image" image="ognl:assets.logo"
width="250" height="100"
alt="message:logo-title"
class="ognl:logoClass"/>
This will be an Image component. The href for the Image is set from the formal image parameter (to
an asset).
The remaining four attributes are informal parameters. The first two are literal. "alt" is set
from a localized message in the page's messages file.
The final attribute, "class", is take from the method getLogoClass() on the page [*].
[*] For simplicit, I usually talk about a simple hierarchy where a page contains components.
However, components can contain other components and you should
substitute "container" for "page".
>
> 3. What are the issues with using XHTML, or XML & XSLT? Is
> there a way for Tapestry to output XML with XSLT for the
> templates of the components? Would I have to write my own
> engine service for that? Why isn't there a way to specify in
> the specification the file name and type for the template (it
> seems to me this should be a must)?
There simply hasn't been a call for this functionality. It's entirely possible using new services.
>
> 4. In the localization section of the developer's guide, it
> mentions that Tapestry allows multiple versions of templates
> and assets. So how is this done? Does the template HAVE to
> have the same root name as the jwc file or can I name it
> whatever? And where do I specify which template I want the
> component to use? Is this only used for localization? I think
> the template should not be so highly coupled to the
> component, especially when you already have an xml
> specification that is supposed to remove the coupling of the
> java and the template.
No, it's the same approach taken with assets. So you can have Home.html, Home_fr.html and
Home_de.html.
>
> 5. Why can't I place my reusable component somewhere else in
> the classpath and still use it? The documentation seems to
> say you can, but I haven't got it working yet. Does it have
> to be a private asset and defined as such in the application
> specification? Or am I just not configuring correctly?
I'm not sure I follow you. If a component is used only in your application, then you can place its
component specification (.jwc) file in WEB-INF, along with its HTML template (if it has one). It's
code is part of your application and should end up in WEB-INF/classes.
If you component is reusable across applications, you should package it into a component library and
distribute it as a JAR.
A private asset is a way such a component can still provide assets (such as images and stylesheets)
even though it is inside a JAR. The framework takes care of either exporting the asset to the
filesystem or serving up the content as a bytestream (depending on how you have Tapestry
configured).
>
> 6. Without reading each of the items in the ''What's New''
> section ( though I did skim them a bit), what are the major
> changes in version 3.0 that make the Developer's guide so out-dated?
Version 3.0 adds a *lot*, but the important parts are:
1) Implicit components in HTML templates
2) Can put specs in WEB-INF and templates in context
3) Can omit most specifications (including app spec)
4) <property-specification> element in page and component spec (along with all the class enhancement
stuff)
5) Improved handling of component parameters (generally, more class enhancement)
>
> 7. Docs said that page objects are pooled to increase
> performance since the templates and specs are interpreted at
> run time. So I guess the page java objects are pooled, so
> only a few instances are instantiated so as to overcome
> overhead of creating an object for each hit, and the
> templates and specs are interpreted at each hit. So what
> exactly is happening when the docs say the pages are cached?
> Is this referring to the pooling? I don't think so, therefore
> I've got to be missing something.
A pooled page includes the page instance, all components, all bindings, all templates, etc.
Tapestry is very efficient at rendering once the page is fully constructed.
When a new page is instantiated, its still relatively efficient: the templates will already have
been located and parsed, as will the specifications. However, there's still quite a bit of
instantiating of objects and assigning of properties to do.
Parsing a template involves reading the template, finding all the components and other stuff and
turning it into a list of tokens. In additionk there's a whole threading process involved in
assigning each template token to the right component's body.
>
> 8. Please send me a list of websites and applications,
> including URLs if possible, who are using Tapestry
> (preferrably 3.0, and please specify the version in use) in
> mission critical production systems. I have been really
> impressed with Tapestry, and would like some extra "ammo"
> with which to sell the Tapestry idea to our management. If
> you could also provide some more detail on testing results
> with high-load, transactional applications, that would really
> help. I would appreciate this type of information a great deal.
>
That I can't help directly with, but there are several out there that I know of (Joel?).
>
> --
> Dan Wells <da...@byu.edu>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>