Current status (and some questions) on markup inheritance

Assuming your base class markup looks like:
  base: before
  <wicket:child/>
  base: after

and your subclass markup like:
extension: before
<wicket:extend>
  extension: middle
</wicket:extend>
extension: after

than what currently will be returned is:
extension: before
<wicket:extend>  
  base: before
  <wicket:child>
    extension: middle
  </wicket:child>
  base: after
</wicket:extend>
extension: after

But I wonder if stripping "extension: before" and "extension:after"
makes more sense. It would make it more consistent with Panel and
Border as well. I failed to come up with an use case where I actually
need extension:before/after. What do you think?

Automatically stripping extension:before/after however is not easy as
well. Reason: The only thing that differs from a "normal" Page is
<wicket:extend>. In order to know whether to remove the preceding
RawMarkup is by reading-ahead and checking if there is a
<wicket:extend> or not. And I'm not very fond of reading ahead.

Assuming there is no value to extension:before/after what about the
idea of not using <wicket:extend> at all (just merge the whole markup
with superclass markup at <wicket:child>) and using a marker interface
or a flag/property to be set with the Component. Component/Page would
than decide on the interface or the property whether to inherit the
markup or not.

One more question: I was thinking about the component hierachy. I
assume it makes sense (avoid the problem of identical component names)
to separate the base markup/class and subclass markup/class into two
separate components, e.g.   ..../<subclass-id>/_child. Assuming your
base class markup is inherited as well, you'd end up with hierachies
like .../<subclass-id>/_child/_child. Base class components gets added
to _child and subclass components to <subclass-id>. Does that make
sense?

Juergen


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to