Industrial Logic Refactoring to Patterns Catalog Encapsulate Classes with Factory

Encapsulate Classes with Factory

Clients directly instantiate classes that reside
in one package and implement a common interface.

Make the class constructors non-public and let clients
create instances of them using a Factory.

  Industrial Logic, Inc.

 
Refactorings
· Chain Constructors
· Compose Method
· Encapsulate Classes with Factory
· Encapsulate Composite with Builder
· Extract Adapter
· Extract Composite
· Extract Parameter
· Form Template Method
· Inline Singleton
· Introduce Null Object
· Introduce Polymorphic Creation with Factory Method
· Limit Instantiation with Singleton
· Move Accumulation to Collecting Parameter
· Move Accumulation to Visitor
· Move Creation Knowledge to Factory
· Move Embellishment to Decorator
· Replace Conditional Dispatacher with Command
· Replace Conditional Logic with Strategy
· Replace Constructors with Creation Methods
· Replace Hard-Coded Notifications with Observer
· Replace Implicit Language with Interpreter
· Replace Implicit Tree with Composite
· Replace One/Many Distinctions with Composite
· Replace State-Altering Conditionals with State
· Replace Type Code with Class
· Unify Interfaces
· Unify Interfaces with Adapter


FacebookFacebook  TwitterTwitter  linked inLinkedIn