background preloader

Programming

Facebook Twitter

Ontology Design Patterns . org (ODP) - Odp. Ontology Design Patterns. Refactoring to Patterns Catalog. Design Patterns---JavaCamp.org. Alpha list of refactorings. You have constructors on subclasses with mostly identical bodies. Create a superclass constructor; call this from the subclass methods. more… Two subclasses have the same field. Move the field to the superclass. more… You have methods with identical results on subclasses. Move them to the superclass. more… A field is used only by some subclasses. Move the field to those subclasses. more… Behavior on a superclass is relevant only for some of its subclasses. Move it to those subclasses. more… You have conditional code that is unnecessarily verbose and does not use the most readable Ruby construct.

Replace the conditional code with the more idiomatic Ruby construct. more… Remove Assignments to Parameters The code assigns to a parameter. Use a temporary variable instead. more… You have a variable that is acting as a control flag for a series of boolean expressions. Use a break or return instead. more… A class is doing too much simple delegation. Get the client to call the delegate directly. more… more… Remove it. more…