Zach Dennis will be leading a tutorial at RailsConf 2008. The topic he will be presenting on Refactoring Your Rails Application.
Tutorial Details
Time: 8:30am - 12:00pm Thursday, 05/29/2008
Location: Portland Ballroom 251
Summary
Refactoring is an essential part of a developer's life. It can be difficult to know when or what to refactor in a Rails application. Some common and more noticeable signs that you need to refactor are:
- controllers becomes bloated
- models become bloated
- the view ends up embedding logic within its template
- view helpers become large and complex, both in size and in number of methods
- view partials rely on instance variables and constants rather then local variables
- models start doing work for the view
- tests become large, complex and painful to maintain
Refactoring should be a continual process throughout the life of an application. In order to refactor well it requires the developer to have proper techniques, tools and discipline. For example:
- applying the single responsibility principle
- extracting objects from bloated methods
- splitting objects into two
- identifying what goes in a model and what doesn't
- identifying what goes in a controller and what doesn't
- extracting presenters
- when to use classes and when to use modules
- using integration tests to help you refactor
- writing better tests
- writing clear and meaningful code
In this talk we will show the audience how to use the above refactoring techniques and tools to keep their Rails project humming along through development. Not only will they be able to apply these techniques to existing code, but they will be able to use these techniques to write better code from this point forward.