You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Randolph Kahle <ra...@variantia.net> on 2004/10/14 02:09:22 UTC

When do I need to define an embedded component?

I have a very simple Border component that renders wrapper HTML and has 
a single

<span jwcid="@RenderBody" />

directive.

In the Border.html file I use a Copyright component that also simply 
sends

copyright xxx 2004, all rights reserved

to the output.

I noticed that my program works with having to declare the Copyright 
component in the Border.jwc file.

What warrants the inclusion of a <component> element in another 
component's .jwc file?

Regards,

Randy Kahle

When do I need a .jwc file?

Posted by Andreas Vombach <an...@psi.ch>.
As far as I know from reading the .jwc file is needed for component 
specification whereas in the .page file page specification is stored.
But every page consists of components so I wonder is it a good idea / 
possible to store specifications in a .jwc even if the page is not 
intended to be used as component? (there may be some basics missing from 
my understanding)

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


Re: When do I need to define an embedded component?

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Oct 13, 2004, at 10:48 PM, Randolph Kahle wrote:
> If I may follow up then.
>
> At what point does one need to move from informal to formal?

It's really a matter of taste/style.  Projects that have real web 
designers (not those fake programmer web designers!) that want to work 
on the pages in professional web design tools should use the formal 
syntax so the types of components and their parameter bindings are in 
the specification files, not the templates.  This provides a very clean 
separation.

I personally prefer to stick with the informal syntax for as long as 
possible to avoid indirection.  In Eclipse, Spindle makes it easy to 
move an informally defined component into the spec.

> Is there an architecturally defined distinction between the two or has 
> the addition of informal been an ad-hoc change?

I'm not understanding the question.  Both are equivalent in 
functionality.  The informal syntax was added as a "Tapestry Lite" to 
allow for less formal and easier to code templates.

Do what works best for your environment, I'd recommend.  Neither is 
more right or more wrong.

	Erik

>
> On Oct 13, 2004, at 5:35 PM, Erik Hatcher wrote:
>
>> Randy,
>>
>> There are two styles of declaring components.  I prefer to call the 
>> two styles formal and informal.
>>
>> Originally Tapestry only allowed formal syntax, that of declaring 
>> <component> in the specification file, and using mapping names in the 
>> templates.  What you've done with @RenderBody, and I'm assuming 
>> @Copyright, is use and declare the component in one step informally 
>> (which is a new feature in Tapestry 3.0).  The informal syntax 
>> technically blurs the separation between view and model and purists 
>> would argue it should not be used.
>>
>> I'm not sure if I clarified this for you or not.  Keep asking if I've 
>> not been clear.
>>
>> 	Erik
>>
>> On Oct 13, 2004, at 8:09 PM, Randolph Kahle wrote:
>>
>>> I have a very simple Border component that renders wrapper HTML and 
>>> has a single
>>>
>>> <span jwcid="@RenderBody" />
>>>
>>> directive.
>>>
>>> In the Border.html file I use a Copyright component that also simply 
>>> sends
>>>
>>> copyright xxx 2004, all rights reserved
>>>
>>> to the output.
>>>
>>> I noticed that my program works with having to declare the Copyright 
>>> component in the Border.jwc file.
>>>
>>> What warrants the inclusion of a <component> element in another 
>>> component's .jwc file?
>>>
>>> Regards,
>>>
>>> Randy Kahle
>>
>>
>> ---------------------------------------------------------------------
>> 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: When do I need to define an embedded component?

Posted by Randolph Kahle <ra...@variantia.net>.
Erik,

Yes, the answer is clear.

If I may follow up then.

At what point does one need to move from informal to formal?

Is there an architecturally defined distinction between the two or has 
the addition of informal been an ad-hoc change?

Regards,

Randy


On Oct 13, 2004, at 5:35 PM, Erik Hatcher wrote:

> Randy,
>
> There are two styles of declaring components.  I prefer to call the 
> two styles formal and informal.
>
> Originally Tapestry only allowed formal syntax, that of declaring 
> <component> in the specification file, and using mapping names in the 
> templates.  What you've done with @RenderBody, and I'm assuming 
> @Copyright, is use and declare the component in one step informally 
> (which is a new feature in Tapestry 3.0).  The informal syntax 
> technically blurs the separation between view and model and purists 
> would argue it should not be used.
>
> I'm not sure if I clarified this for you or not.  Keep asking if I've 
> not been clear.
>
> 	Erik
>
> On Oct 13, 2004, at 8:09 PM, Randolph Kahle wrote:
>
>> I have a very simple Border component that renders wrapper HTML and 
>> has a single
>>
>> <span jwcid="@RenderBody" />
>>
>> directive.
>>
>> In the Border.html file I use a Copyright component that also simply 
>> sends
>>
>> copyright xxx 2004, all rights reserved
>>
>> to the output.
>>
>> I noticed that my program works with having to declare the Copyright 
>> component in the Border.jwc file.
>>
>> What warrants the inclusion of a <component> element in another 
>> component's .jwc file?
>>
>> Regards,
>>
>> Randy Kahle
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

Re: When do I need to define an embedded component?

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Randy,

There are two styles of declaring components.  I prefer to call the two 
styles formal and informal.

Originally Tapestry only allowed formal syntax, that of declaring 
<component> in the specification file, and using mapping names in the 
templates.  What you've done with @RenderBody, and I'm assuming 
@Copyright, is use and declare the component in one step informally 
(which is a new feature in Tapestry 3.0).  The informal syntax 
technically blurs the separation between view and model and purists 
would argue it should not be used.

I'm not sure if I clarified this for you or not.  Keep asking if I've 
not been clear.

	Erik

On Oct 13, 2004, at 8:09 PM, Randolph Kahle wrote:

> I have a very simple Border component that renders wrapper HTML and 
> has a single
>
> <span jwcid="@RenderBody" />
>
> directive.
>
> In the Border.html file I use a Copyright component that also simply 
> sends
>
> copyright xxx 2004, all rights reserved
>
> to the output.
>
> I noticed that my program works with having to declare the Copyright 
> component in the Border.jwc file.
>
> What warrants the inclusion of a <component> element in another 
> component's .jwc file?
>
> Regards,
>
> Randy Kahle


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