Search the web
Sign In
New User? Sign Up
dpexplained · Design Patterns Explained
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Re: Digest Number 183   Message List  
Reply | Forward Message #480 of 485 |
Re: [dpexplained] Digest Number 183

Thanks Chris
 
I indeed ended up using the Brdige pattern

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

Mon Nov 1, 2004 10:20 pm

jason7200g
Offline Offline
Send Email Send Email

Forward
Message #480 of 485 |
Expand Messages Author Sort by Date

Jason - Try the "Bridge" pattern. Chris Falter dpexplained@yahoogroups.com wrote: There is 1 message in this issue. Topics in this digest: 1. Skins OOD...
Chris Falter
chrisfalter
Offline Send Email
Nov 1, 2004
9:58 pm

Thanks Chris I indeed ended up using the Brdige pattern Chris Falter <chrisfalter@...> wrote: Jason - Try the "Bridge" pattern. Chris Falter ...
mark marky
jason7200g
Offline Send Email
Nov 12, 2004
4:09 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help