Industrial Logic Refactoring to Patterns Catalog Replace One/Many Distinctions with Composite

Replace One/Many Distinctions with Composite

A class processes single and multiple objects
using separate pieces of code.

Use a Composite to produce one piece of code
capable of handling single or multiple objects.

  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