You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Mindbridge <mi...@yahoo.com> on 2003/03/14 23:26:01 UTC
Re: Why are multiple references to components not allowed ?
(transferred from tapestry-user)
Hi,
In my experience the majority of cases where there is duplicate jwcid in
the template are due to a bug, rather than an intentional behaviour
(typically resulting from copy-paste). This is not to say that having the
ability to easily utilize the same component configuration multiple times is
not useful, on the contrary, our experience seems to show that it often is.
In 2.3 the 'copy-of' attribute helps (it does not seem to have been
mentioned a lot in this discussion). In 2.4 the implicit components make
multiple use easy as well, but they would not be that helpful if the
component has a lot of arguments (since they would have to be copied from
instance to instance as well).
Here is a suggestion that I think should fit well the 2.4 general
approach: mark the jwcid's that need to be copies of existing components,
e.g. by prepending a symbol to the component id.
In other words, the following syntax:
<span jwcid="+ComponentId"/>
could be functionally equivalent to:
<component id="NewComponentId" copy-of="ComponentId"/> (in the
.jwc)
<span jwcid="NewComponentId"/>
That would make 'multiple' use of the same component trivial, would not
invite propagation of bugs, and would be within the spirit of Tapestry (I
believe).
Thoughts?
-mb
Re: Why are multiple references to components not allowed ?
Posted by Richard Lewis-Shell <rl...@mac.com>.
Welcome back mb!
I think this is a good idea, but do we really need more special syntax?
Can Tapestry not figure out that the id is replicated, and copy the
component automatically? (I think this has been suggested before) To
make debugging/tracing what actually happened easier, the copied
component id/name could be given some suffix indicating it is a copy I
guess - ComponentId_copy1, ComponentId_copy2 etc. or ComponentId$1,
ComponentId$2...
R
On Saturday, March 15, 2003, at 11:26 AM, Mindbridge wrote:
> (transferred from tapestry-user)
>
> Hi,
>
> In my experience the majority of cases where there is duplicate
> jwcid in
> the template are due to a bug, rather than an intentional behaviour
> (typically resulting from copy-paste). This is not to say that having
> the
> ability to easily utilize the same component configuration multiple
> times is
> not useful, on the contrary, our experience seems to show that it
> often is.
>
> In 2.3 the 'copy-of' attribute helps (it does not seem to have been
> mentioned a lot in this discussion). In 2.4 the implicit components
> make
> multiple use easy as well, but they would not be that helpful if the
> component has a lot of arguments (since they would have to be copied
> from
> instance to instance as well).
>
> Here is a suggestion that I think should fit well the 2.4 general
> approach: mark the jwcid's that need to be copies of existing
> components,
> e.g. by prepending a symbol to the component id.
>
> In other words, the following syntax:
>
> <span jwcid="+ComponentId"/>
>
> could be functionally equivalent to:
>
> <component id="NewComponentId" copy-of="ComponentId"/> (in
> the
> .jwc)
>
> <span jwcid="NewComponentId"/>
>
>
> That would make 'multiple' use of the same component trivial,
> would not
> invite propagation of bugs, and would be within the spirit of Tapestry
> (I
> believe).
>
> Thoughts?
>
> -mb
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>