gang-of-4-patterns AT lists.siebelschool.illinois.edu
Subject: Design Patterns discussion
List archive
- From: "Chris Finlayson" <cfinlayson AT vls-inc.com>
- To: <gang-of-4-patterns AT cs.uiuc.edu>
- Subject: RE: RE : [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern
- Date: Thu, 6 Nov 2003 10:47:17 -0700
- Importance: Normal
- List-archive: <http://mail.cs.uiuc.edu/pipermail/gang-of-4-patterns/>
- List-id: Design Patterns discussion <gang-of-4-patterns.cs.uiuc.edu>
Hi all:
Thanks for all the prompt, thorough responses. It's been quite helpful.
Everyone's response has been terriffic.
I'll share one response I received that I thought was very succinct and
clear. I'll keep the author's name anonymous since he sent me his response
directly:
"A bridge sits on top of an adapter. The definition of JDBC is an
example of the Bridge pattern. The actual MySql JDBC driver would be an
example of the adapter.
Note that the intent of JDBC is to define a common API that adapters can
plug into. The overall definition of AWT, Swing or SWT are also
bridges, with the implementation on particular OS/Graphics library being
an adapter.
The bridge creates a common API and permits multiple implementations via
the Adapter pattern.
The Strategy pattern simply supports plugging in different algorithms at
run-time, as you and Gosling demonstrate with different typs of sorting.
To me, a more confusing example is State versus Strategy. I finally
decided that if I would implement it with a set of inner class, then it
was an example of the State pattern. Otherwise, it was a likely
candidate for the Strategy pattern. By that distintion, obviously, only
the one outer class can use the State inner-classes, while the Strategy
pattern can be shared between different classes."
--Chris.
> -----Original Message-----
> From:
> gang-of-4-patterns-admin AT cs.uiuc.edu
> [mailto:gang-of-4-patterns-admin AT cs.uiuc.edu]On
> Behalf Of Mikal Ziane
> Sent: Thursday, November 06, 2003 9:27 AM
> To:
> gang-of-4-patterns AT cs.uiuc.edu
> Subject: RE : [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern
>
>
> Hi Ray and Chris,
>
> I wonder if Chris' question is not : can Bridge be seen as
> a refinement
> of Strategy in which you add subclasses to Strategy's Context ?
> In Ray's modem example the interfaces would be :
> ModemType (Context) and ModemManufacturer (Strategy).
>
> What do you think ?
>
>
> _______________________________________________
> gang-of-4-patterns mailing list
> gang-of-4-patterns AT cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/gang-of-4-patterns
>
>
- [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern, Chris Finlayson, 11/05/2003
- Re: [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern, Wayne Cannon, 11/06/2003
- RE: [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern, Paul Adolph, 11/06/2003
- RE : [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern, ziane, 11/06/2003
- RE : [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern, Paul Adolph, 11/06/2003
- RE : [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern, Mikal Ziane, 11/07/2003
- RE : [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern, Paul Adolph, 11/06/2003
- RE : [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern, ziane, 11/06/2003
- RE: [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern, Paul Adolph, 11/06/2003
- Re: [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern, Wayne Cannon, 11/06/2003
- <Possible follow-up(s)>
- RE: [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern, Ray Ye, 11/06/2003
- RE : [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern, Mikal Ziane, 11/06/2003
- RE: RE : [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern, Chris Finlayson, 11/06/2003
- RE: RE : [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern, David Rosenstrauch, 11/06/2003
- State and strategy [was RE : [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern], Peter Horan, 11/06/2003
- Re: State and strategy [was RE : [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern], Wayne Cannon, 11/06/2003
- Re: RE : [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern, Wayne Cannon, 11/07/2003
- RE: RE : [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern, Chris Finlayson, 11/06/2003
- RE : [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern, Mikal Ziane, 11/06/2003
- Re: [gang-of-4-patterns] Strategy Pattern vs. Bridge Pattern, Wayne Cannon, 11/06/2003
Archive powered by MHonArc 2.6.16.