Welcome to Cincinnati .Net Users Group Sign in | Join | Help
in Search

CINNUG Blog

Welcome to the blog for the Cincinnati .Net Users Group.

Phil Japikse on Development Patterns for Mere Mortals - October CINNUG

"The goal is not to bend devs to the will of a specific pattern, but to get them to think about their work and what they're doing." They need to apply critical thought.

SOLID - Single Responsibility Principle, Open/Closed Principle, Liskov Substitution principle, Interface Segregation Principle, Dependency Inversion Principle

Have you had to maintain code that goes for more than one screen? Wow. Too many responsibilities in the code. As changes are made, and complexity introduced, then the quality degrades. Single responsibility is the rule.

How many times code breaks because you change the base class with unintended side effects. Should be able to extend classes but not modify them.

Liskov is coding to an interface. I shouldn't care where the instantiation came from.

Make fine grained interfaces to match specific needs. Create an interface that only applies to what I need.

Depend on abstractions, not concrete implementations. Use something, don't instantiate something unless using a factory.

So what are design patterns? GOF is a dry read. General reusable solutions to a common problem. Enables communication but may not be code. They are conceptual. Google SOLID and you'll find all sorts of resources.

Three types: Creational, Structural, and Behavioral

Creational

  • Singleton
  • Factory - simple, factory, abstract

Structural

  • Adapter
  • Decorator
  • Facade

Behavioral

  • Command
  • Strategy

Phil spent the rest of the evening walking through a number of design patterns in code.

 

Resources:

The classic Gang Of Four book Design Patterns

The readable patterns book Head First Design Patterns

www.dofactory.com

 

Published Oct 27 2009, 08:08 PM by axerickson
Filed under: ,

Comments

No Comments

This Blog

Syndication

Powered by Community Server (Commercial Edition), by Telligent Systems