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. 'Factory' pattern?

'Factory' pattern?

Scheduled Pinned Locked Moved Design and Architecture
javaregexquestionlearning
5 Posts 5 Posters 2 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.
  • F Offline
    F Offline
    flyingxu
    wrote on last edited by
    #1

    I heard someone talks about 'Factory' pattern, but in the GoF book, I just find 'Abstract Factory' & 'Factory Method' pattern. Is there really a pattern named 'Factory', or it's just something in Java?

    P D M S 4 Replies Last reply
    0
    • F flyingxu

      I heard someone talks about 'Factory' pattern, but in the GoF book, I just find 'Abstract Factory' & 'Factory Method' pattern. Is there really a pattern named 'Factory', or it's just something in Java?

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

      This is really just a contraction of the Factory patterns. Basically, we have Concrete and Abstract Factory patterns.

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

      1 Reply Last reply
      0
      • F flyingxu

        I heard someone talks about 'Factory' pattern, but in the GoF book, I just find 'Abstract Factory' & 'Factory Method' pattern. Is there really a pattern named 'Factory', or it's just something in Java?

        D Offline
        D Offline
        DavidNohejl
        wrote on last edited by
        #3

        Yes, of course there is factory pattern. It's something like this:

               ==
              ==
             =
           \_\_
           ||
           ||
        

        /|/|/|/ |/|
        | [] [] |
        | |

        Slow day at work, eh. :-O


        "Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe

        1 Reply Last reply
        0
        • F flyingxu

          I heard someone talks about 'Factory' pattern, but in the GoF book, I just find 'Abstract Factory' & 'Factory Method' pattern. Is there really a pattern named 'Factory', or it's just something in Java?

          M Offline
          M Offline
          Moak
          wrote on last edited by
          #4

          flyingxu wrote:

          Is there really a pattern named 'Factory', or it's just something in Java?

          Yup, software patterns are language independent.. see it as a concept with a name, it makes commucation between developers easier (once they know the meaning of a pattern). Here one example of use for a factory in C++: A plugin (in form of a shared library) has typically one static function in a DLL that creates and returns a new plugin instance/object to the caller. Hope it helps.

          1 Reply Last reply
          0
          • F flyingxu

            I heard someone talks about 'Factory' pattern, but in the GoF book, I just find 'Abstract Factory' & 'Factory Method' pattern. Is there really a pattern named 'Factory', or it's just something in Java?

            S Offline
            S Offline
            Sameerkumar Namdeo
            wrote on last edited by
            #5

            Yes you can create a class which can provide you the desired objects. such class can be a Factory. Stack *pStack = CFactory::GetStack(n); where n -> type of stack. Sameer();

            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