Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Ruby Science
Ruby Science
Introduction
Code Reviews
Follow Your Nose
Removing Resistance
Bugs and Churn
Metrics
How To Read This Book
Long Method
Symptoms
Example
Solutions
Large Class
Symptoms
Example
Solutions
Prevention
God Class
Feature Envy
Symptoms
Example
Solutions
Case Statement
Symptoms
Type Codes
Example
Solutions
Shotgun Surgery
Symptoms
Example
Solutions
Divergent Change
Symptoms
Example
Solutions
Prevention
Long Parameter List
Symptoms
Example
Solutions
Duplicated Code
Symptoms
Example
Solutions
Uncommunicative Name
Symptoms
Example
Solutions
Single Table Inheritance (STI)
Symptoms
Example
Solutions
Prevention
Comments
Symptoms
Example
Solutions
Mixin
Symptoms
Example
Solutions
Prevention
Callback
Symptoms
Example
Solutions
Replace Conditional with Polymorphism
Uses
Example
Replace Type Code With Subclasses
Single Table Inheritance (STI)
Extracting Type-Specific Code
Polymorphic Partials
Multiple Polymorphic Views
Drawbacks
Next Steps
Replace conditional with Null Object
Uses
Example
Drawbacks
Next Steps
truthiness, try, and other tricks
Extract method
Uses
Example
Replace temp with query
Other Examples
Next Steps
Rename Method
Uses
Example
Next Steps
Extract Class
Uses
Example
Drawbacks
Next Steps
Extract Value Object
Uses
Example
Next Steps
Extract Decorator
Uses
Example
Drawbacks
Next Steps
Extract Partial
Uses
Steps
Example
Next Steps
Extract Validator
Uses
Example
Next Steps
Introduce Explaining Variable
Uses
Example
Next Steps
Introduce Form Object
Uses
Example
Next Steps
Introduce Parameter Object
Uses
Example
Next Steps
Introduce Facade
Use class as Factory
Uses
Example
Next Steps
Move method
Uses
Dangerous: move and extract at the same time
Next Steps
Inline class
Uses
Example
Drawbacks
Next Steps
Inject dependencies
Uses
Example
Drawbacks
Next Steps
Replace Subclasses with Strategies
Uses
Example
Drawbacks
Next Steps
Replace mixin with composition
Uses
Example
Next Steps
Replace Callback with Method
Uses
Steps
Example
Next Steps
Use convention over configuration
Uses
Example
Scoping constantize
Drawbacks
DRY
Duplicated Knowledge vs Duplicated Text
Application
Single responsibility principle
Reasons to change
Stability
Cohesion
Responsibility Magnets
Tension with Tell, Don't Ask
Drawbacks
Application
Tell, Don't Ask
Encapsulation of Logic
Encapsulation of State
Minimal Public Interface
Tension with MVC
Application
Law of Demeter
Multiple Dots
Multiple Assignments
The Spirit of the Law
Objects vs Types
Duplication
Application
Composition over inheritance
Inheritance
Composition
Dynamic vs Static
Dynamic Inheritance
The trouble With Hierarchies
Mixins
Single Table Inheritance
Drawbacks
Application
Open/closed principle
Strategies
Inheritance
Decorators
Dependency Injection
Everything is Open
Monkey Patching
Drawbacks
Application
Dependency inversion principle
Inversion of Control
Where To Decide Dependencies
Drawbacks
Application
← Prev
Back
Next →
← Prev
Back
Next →