Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 156725

In object-oriented programming (OOP), a factory is an object for creating other objects.

6 votes

Does the Factory Pattern violate the Open/Closed Principle?

The simple answer to this question is as follows: Create your base functionality using Factory Method Pattern. … To do this WITHOUT violating OCP, you must create an additional factory to support your new shapes (let's called AdvancedShapeFactory) and then use AbstractFactory to decide what factory you need to create …
hfontanez's user avatar
  • 211