Thanks Chris
I indeed ended up using the Brdige pattern
Chris Falter <chrisfalter@...> wrote:
Chris Falter <chrisfalter@...> wrote:
Jason -Try the "Bridge" pattern.Chris Falter
dpexplained@yahoogroups.com wrote:
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~->
There is 1 message in this issue.
Topics in this digest:
1. Skins OOD question
From: "jason7200g"
________________________________________________________________________
________________________________________________________________________
Message: 1
Date: Thu, 14 Oct 2004 00:39:38 -0000
From: "jason7200g"
Subject: Skins OOD question
Hello
Imagine the need to support a system of skins. Each skin should know
how to render a specific entity. A skin could have the following
abstract functions:
- renderButton
- rednerTable
- renderHeader
and so on.
The output of these functions should be HTML which provides a
concrete implementation based on the skin.
We could have a 'wood' skin which renders its button in a brownish
color, a metal looking skin, and so on.
The complication comes from the requirement that the skin
implementation cannot be browser dependent.
There could be a Firefox implementation for each of the skins and
yet an IE implementation and possibly a few other supported browsers.
This forms two sibling hierarchies with the Browser abstract class
at the top of one and abstract Skin at the top of the other.
My question is, how can I combine these two hierarchies in a smart
way so that I will be able to easily support new skins and new
browsers?
I don't want to end up writing classes like: MetalIESkin,
WoodFirefoxSkin and so on because this solution isn't robust.
I was thinking about having the Skin functions take a Browser object
as a parameter and then user it to render themselves, but I am not
sure how this helps me.
My ultimate solution should have an isolated code that knows how to
render the metal button for IE (for example).
I was thinking about the Abstract factory and Prototype design
patterns but I fail to take them into the next step and using them
to achieve my goal
I would appreciate any help you could offer me
Regards
________________________________________________________________________
________________________________________________________________________
------------------------------------------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/dpexplained/
<*> To unsubscribe from this group, send an email to:
dpexplained-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
------------------------------------------------------------------------
Do you Yahoo!?
Check out the new Yahoo! Front Page. www.yahoo.com
Do you Yahoo!?
Check out the new Yahoo! Front Page. www.yahoo.com