Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Design and Architecture
  4. Desgin pattern...

Desgin pattern...

Scheduled Pinned Locked Moved Design and Architecture
designregexarchitecturequestion
16 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Luc Pattyn

    This one has puzzled me before. Valves, pumps, and the like sound very concrete, yet they want to call it an abstract factory? :)

    Luc Pattyn [Forum Guidelines] [My Articles]


    Voting for dummies? No thanks. X|


    L Offline
    L Offline
    led mike
    wrote on last edited by
    #7

    Luc Pattyn wrote:

    yet they want to call it an abstract factory?

    What are you guys talking about? Isn't the pattern supposed to use the implementation of an abstract class for the factory and the user derives from it implementing the concrete factories? Or am I not remembering the pattern correctly?

    led mike

    P 1 Reply Last reply
    0
    • P Pete OHanlon

      I know. It's a really crappy name. Really really crappy.

      Deja View - the feeling that you've seen this post before.

      My blog | My articles

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #8

      I'm confused[^]

      led mike

      1 Reply Last reply
      0
      • L led mike

        Luc Pattyn wrote:

        yet they want to call it an abstract factory?

        What are you guys talking about? Isn't the pattern supposed to use the implementation of an abstract class for the factory and the user derives from it implementing the concrete factories? Or am I not remembering the pattern correctly?

        led mike

        P Offline
        P Offline
        Pete OHanlon
        wrote on last edited by
        #9

        You are remembering it correctly. It's just a name that I have a problem with just because it sounds like you can directly instantiate abstract classes. I'm not sure what they should call it, but I've had staff being confused about this when they complain about their code not working because it's abstract.

        Deja View - the feeling that you've seen this post before.

        My blog | My articles

        L 1 Reply Last reply
        0
        • P Pete OHanlon

          You are remembering it correctly. It's just a name that I have a problem with just because it sounds like you can directly instantiate abstract classes. I'm not sure what they should call it, but I've had staff being confused about this when they complain about their code not working because it's abstract.

          Deja View - the feeling that you've seen this post before.

          My blog | My articles

          L Offline
          L Offline
          led mike
          wrote on last edited by
          #10

          Pete O'Hanlon wrote:

          but I've had staff being confused about this when they complain about their code not working because it's abstract.

          Sorry to hear that. On the bright side at least you work with people that use the word "Abstract"! That's more than I can say! :((

          led mike

          P 1 Reply Last reply
          0
          • L led mike

            Pete O'Hanlon wrote:

            but I've had staff being confused about this when they complain about their code not working because it's abstract.

            Sorry to hear that. On the bright side at least you work with people that use the word "Abstract"! That's more than I can say! :((

            led mike

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #11

            led mike wrote:

            at least you work with people that use the word "Abstract"! That's more than I can say!

            Ouch. X|

            Deja View - the feeling that you've seen this post before.

            My blog | My articles

            L 1 Reply Last reply
            0
            • P Pete OHanlon

              led mike wrote:

              at least you work with people that use the word "Abstract"! That's more than I can say!

              Ouch. X|

              Deja View - the feeling that you've seen this post before.

              My blog | My articles

              L Offline
              L Offline
              led mike
              wrote on last edited by
              #12

              Dude, it looks like you are being stalked by a 2.0 voter? Even I don't have a stalker! :laugh::laugh:

              led mike

              P 1 Reply Last reply
              0
              • L led mike

                Dude, it looks like you are being stalked by a 2.0 voter? Even I don't have a stalker! :laugh::laugh:

                led mike

                P Offline
                P Offline
                Pete OHanlon
                wrote on last edited by
                #13

                led mike wrote:

                Dude, it looks like you are being stalked by a 2.0 voter? Even I don't have a stalker!

                Damn. I'm not even worthy of a Univoter. :laugh:

                Deja View - the feeling that you've seen this post before.

                My blog | My articles

                D 1 Reply Last reply
                0
                • P Pete OHanlon

                  I know. It's a really crappy name. Really really crappy.

                  Deja View - the feeling that you've seen this post before.

                  My blog | My articles

                  D Offline
                  D Offline
                  dojohansen
                  wrote on last edited by
                  #14

                  Nooooo. It is a good name, though just as good and maybe better would be static factory. The factory itself is usually a class with only static methods, so it should be static (or abstract, though static is perhaps the more academically pleasing choice since it's not intended as a base class for concrete factories but rather just a bunch of static members relating to the same thing). So even though the products of the factory are concrete, the factory itself isn't. Pump p = Factory.CreatePump(...); not Factory f = new Factory(); Pump p = f.CreatePump(...); Normalement.

                  P 1 Reply Last reply
                  0
                  • P Pete OHanlon

                    led mike wrote:

                    Dude, it looks like you are being stalked by a 2.0 voter? Even I don't have a stalker!

                    Damn. I'm not even worthy of a Univoter. :laugh:

                    Deja View - the feeling that you've seen this post before.

                    My blog | My articles

                    D Offline
                    D Offline
                    dojohansen
                    wrote on last edited by
                    #15

                    I often accidentally vote 2.... when a little spaced out it is far too easy to think, as you arrive at the last message, that those numbers represent pages. So I try to navigate to page 2, and get "thank you for voting"..! I must apologize to any victims (none today tho). :D

                    1 Reply Last reply
                    0
                    • D dojohansen

                      Nooooo. It is a good name, though just as good and maybe better would be static factory. The factory itself is usually a class with only static methods, so it should be static (or abstract, though static is perhaps the more academically pleasing choice since it's not intended as a base class for concrete factories but rather just a bunch of static members relating to the same thing). So even though the products of the factory are concrete, the factory itself isn't. Pump p = Factory.CreatePump(...); not Factory f = new Factory(); Pump p = f.CreatePump(...); Normalement.

                      P Offline
                      P Offline
                      Pete OHanlon
                      wrote on last edited by
                      #16

                      This[^] message explains my problem with the name. I prefer the static name you suggest though - it sounds better.

                      Deja View - the feeling that you've seen this post before.

                      My blog | My articles

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups