Factory Design Pattern and Select Case

From: dean hully (deanh_at_foto1.com)
Date: 03/19/05

  • Next message: Phlip: "Re: Factory Design Pattern and Select Case"
    Date: Sat, 19 Mar 2005 11:57:09 -0500
    
    

    I have been involved in another ng that is debating the un oo'ness of
    select case statements in VB.net or C#. The consensus seems to be
    avoid them where possible.

    My problem is in vb.net or C# I always seem to get to the point where
    I need them. What am I missing?

    For instance, in the factory pattern how do I avoid using a select in
    the factory to choose which object to create? One answer has been
    CallByName and another is using the app.config or web.config to create
    a coupling between the variable/property of the client and the
    resulting object created by the factory.

    Any opinions out there?

    Thanks,

    Dean


  • Next message: Phlip: "Re: Factory Design Pattern and Select Case"

    Relevant Pages

    • Re: Factory Design Pattern and Select Case
      ... The consensus seems to be ... > avoid them where possible. ... > resulting object created by the factory. ... Don't duplicate the same kind of switch all over the place. ...
      (comp.object)
    • Re: Factory Design Pattern and Select Case
      ... > avoid them where possible. ... > the factory to choose which object to create? ... can use delegates. ... habits where replacing switch with maps or more pain then necessary so ...
      (comp.object)
    • Re: Factory Design Pattern and Select Case
      ... > avoid them where possible. ... > the factory to choose which object to create? ... IMO, there is nothing wrong with select/case statements, as long as you ... don't have to edit one of them every time you edit some other one. ...
      (comp.object)
    • Re: Things that go wrong - First 21 Days on the ICW
      ... considered that side-stepping one predicament may end you up in another ... The only way to get the consensus on how to do it right is to find the ... Knowing the sailor's consensus of common mishaps helps others who read ... of them avoid those mishaps. ...
      (rec.boats.cruising)
    • Re: On "time, place, and manner" restrictions:
      ...  Knowing this wouldn’t gain a consensus the best way to ... avoid a block is to avoid having a vision council to being with and ...
      (alt.gathering.rainbow)