Ruby Science
Год: 2013
Автор: Joe Ferris, Harlow Ward
Издательство: thoughtbot
Язык: Английский
Формат: PDF, MOBI, EPUB
Качество: Изначально компьютерное (eBook)
Интерактивное оглавление: Да
Количество страниц: 227
ISBN: нет (самиздат)
Описание: You build web applications, and you love Ruby on Rails because it provides
a framework for developing applications that are are fast, fun, and easy to change.
Over time these applications can become bloated, development slows down,
and changes to the codebase become painful.
This book was written to help you learn to detect emerging problems in your
codebase; we’ll deliver the solutions for fixing them, and maintaining an
application that will be fun to work on for years to come.
Оглавление
Table of Contents
Introduction
Code Smells
Long Method
Large Class
Feature Envy
Case Statement
High Fan-out
Shotgun Surgery
Divergent Change
Long Parameter List
Duplicated Code
Uncommunicative Name
Single Table Inheritance (STI)
Parallel Inheritance Hierarchies*
Comments
Mixin
Callback
Solutions
Replace Conditional with Polymorphism
Replace conditional with Null Object
Extract method
Rename Method
Extract Class
Extract Value Object
Extract Decorator
Extract Partial
Extract Validator
Introduce Explaining Variable
Introduce Observer
Introduce Form Object
Introduce Parameter Object
Use class as Factory
Move method
Inline class
Inject dependencies
Replace Subclasses with Strategies
Replace mixin with composition
Replace Callback with Method
Use convention over configuration
Introduce Visitor
Principles
DRY
Single responsibility principle
Tell, Don’t Ask
Law of Demeter
Composition over inheritance
Open/closed principle
Dependency inversion principle