Re: Pattern Question



Let me understand:

You are creating an abstraction whereby the actual type to be used in an
implementation is decided seperately from the use of the type. OK. Sounds
like very simple abstraction. Class Factory and simple inheritance.

Plug in and Registry both assume that the implementing object is compiled
seperately from the object that uses it, and that you use a bit of
redirection to find the proper implementation. However, it sounds like you
Don't want that... you want to decide at compile time, or at best, at run
time. That sounds like the Factory Method pattern.

It's almost too easy of an answer. I must be missing something. If I
misunderstood (quite likely), please provide more details. In a nutshell,
attempt to answer this design question: what is the reason you are adding
indirection in this case?

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
<russell@xxxxxxxxxxxxx> wrote in message
news:1164645191.427647.190820@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am having a discussion with someone in my office about two patterns.


plug-in and registry.

What we are building is a global definition of what type to use in a
particular implementation. This makes it sound like a good match to
plug-in but here is my problem. The way we are doing it allows for the
particular implementations to inherit from each other. In fact core
product types can be replaced via this definition for a particular
implmentation.

My concern with plug-in is that it in the Patterns book I am using
(Martin Fowler's Patterns of Enterprise Application Architecture) talks
about a plug-in pattern as Linking types at configuration time not
compile time. What we are doing does not support the abstraction of
no compile time linking. Is that big enough to though it out of the
pattern?

Registry somewhat imples that you are accessing existing instances of
types. If we are mainly building new instances does that violate that
pattern too.

What you would call the application component defined above?



.



Relevant Pages

  • Re: Pattern Question
    ... The discussion of the plug-in vs registry is a step high on the ... Registry pattern doesn't have the same issue about compile time linking ...
    (comp.object)
  • Re: Pattern Question
    ... description), (this is also like Prog to I'face,LSP --I think registry ... plug-in and registry. ... about a plug-in pattern as Linking types at configuration time not ... no compile time linking. ...
    (comp.object)
  • Re: graph of behavior - was Re: State vs. Data (was Re: Fans of Template Method with protected varia
    ... break the dependency of higher implementation on lower abstraction and ... implementation at compile time, ... > message flow tree is disconnected from the compile time dependency tree. ...
    (comp.object)
  • Re: Pattern Question
    ... The discussion of the plug-in vs registry is a step high on the ... the Dependency Injection pattern and the Service Locator pattern. ... particular interface but may be sub-class of the requested type. ...
    (comp.object)
  • Re: dip Notions 2 Major Errors
    ... >You are confusing principle and realization of the principle. ... >just one way to introduce an abstraction into a system - there are certainly ... The State pattern is a solution with similar ... "The aim of science is not to open the door to infinite wisdom, ...
    (comp.object)