techfest design patterns

50
Design Patterns Claudio Lassala Jonathan Birkholz Houston Techfest 2010 http://tinyurl.com/htf2010-patterns

Upload: rookieone

Post on 06-Dec-2014

1.751 views

Category:

Technology


2 download

DESCRIPTION

Design Patterns presentation from Houston Techfest 2010

TRANSCRIPT

Page 1: Techfest design patterns

Design Patterns

Claudio LassalaJonathan BirkholzHouston Techfest 2010

http://tinyurl.com/htf2010-patterns

Page 2: Techfest design patterns

Claudio Lassala Jonathan Birkholz

[email protected]@claudiolassalaEPS Software Corp

[email protected]

@rookieonewizardsofsmart.net

github.com/RookieOnebitbucket.org/rookieone

Chaione

Page 3: Techfest design patterns

EPS

As an attendee to this session, you are entitled to a free CODE subscription! www.codemag.com/subscribe/htf10

Software ProjectsConsultingTrainingPublishers of CODE Magazine

The .Net Knowledge Powerhouse

Page 4: Techfest design patterns

ChaioneStrategy and PlanningUser Experience DesignMobile SolutionsWeb Solutions

Page 5: Techfest design patterns

:url => snipr.com/virtualaltnet:website => www.virtualbrownbag.com:when => every Thursday from 12pm – 1pm

Where everyone can come talk and learn about software development

Page 6: Techfest design patterns

Learnsomething about design patterns

ApplyTeach

your knowledge at your day job

others what you have learned

Page 7: Techfest design patterns

Different Backgrounds

Same Problems

Page 8: Techfest design patterns

is the only constant in software development

Change

Page 9: Techfest design patterns

change in software is

time consuming expensive

failand is why projects

Page 10: Techfest design patterns

successful

best practicesif only there were some

on how to manage change so that our software projects can be

Page 11: Techfest design patterns

Design Patternsdescribe a concept or process on an abstract level. These patterns arose from repeated successful applications on how to design software to adapt to change

Page 12: Techfest design patterns

Design patterns also provide aconciseform of communication among professionals

Page 13: Techfest design patterns

Every song has structure…•Intros•Verses•Bridges•Choruses•Interludes

Page 14: Techfest design patterns

Ok… so…. I’m going to pretend to hand off the ball but really I am going to pass it. The hope is the defense will be confused for a few seconds so that can create an opening and one of you guys can get open

Play Action Pass?

meanwhile a well organized team is already running their play

More effective communication

Page 15: Techfest design patterns

If design patterns are known best practices why are there no frameworks or libraries for design patterns?

more about form and context than code

allegory of the cave

Page 16: Techfest design patterns

Object Oriented Programming

Abstraction

Encapsulation

Polymorphism

Inheritance

Page 17: Techfest design patterns

Principles

Program to interface, not to implementation

Strive for loosely coupled designs between objects that interact

Favor composition over inheritance

SOLIDPrinciples => form => design pattern

Page 18: Techfest design patterns

Cash Register

Learning through code is best

Page 19: Techfest design patterns

LOOK AT CODE

Page 20: Techfest design patterns

REFACTOR

Page 21: Techfest design patterns

Command Patternis a design pattern in which an object

is used to represent and encapsulate all the information needed to execute an operation at a later time

Page 22: Techfest design patterns

with commands you can also…

Queue

Log

Undo

commands in the form of a macro command thereby handling complexity through composition

command execution for future diagnosis of problems and bugs

more easily support

Page 23: Techfest design patterns

Experiences with Command PatternWhere the Command Pattern can be found in .Net

Page 24: Techfest design patterns

REFACTOR

Page 25: Techfest design patterns

Façade Patternprovides a unified interface to a set of interfaces in a subsystem. To put it simply, it makes the complex easy.

Page 26: Techfest design patterns

inside Claudio’s house

Page 27: Techfest design patterns

Too many remotes! Ugh!

subsystems facade

Ah… one remote to rule the all

Page 28: Techfest design patterns

Experiences with Façade PatternWhere the Façade Pattern can be found in .Net

Page 29: Techfest design patterns

REFACTOR

Page 30: Techfest design patterns

Observer Patterndefines a dependency between objects

so that when one object changes, dependent objects can be notified

Publishers + Subscribers = Observer Pattern

Page 31: Techfest design patterns

Stop Pestering…

Let subject call observers

actively querying state on subject

passive

Page 32: Techfest design patterns

Hollywood Principle

Don’t call us, we’ll call you.

Register

Scanner

add item

item scanned

Page 33: Techfest design patterns

Experiences with Observer PatternWhere the Observer Pattern can be found in .Net

Page 34: Techfest design patterns

REFACTOR

Page 35: Techfest design patterns

Adapter Patternconverts the interface of a class into another interface the clients expect

Page 36: Techfest design patterns

Experiences with Adapter PatternWhere the Adapter Pattern can be found in .Net

Page 37: Techfest design patterns

Facade Adapterintent

versus

Page 38: Techfest design patterns

Proxy Patternprovides a surrogate or placeholder for another object to control access to it.

Proxy Real

Page 39: Techfest design patterns

REFACTOR

Page 40: Techfest design patterns

Strategy Patterndefines a family of algorithms, encapsulates each one, and makes them interchangeable.

This lets the algorithm vary independently from clients that use it.

Page 41: Techfest design patterns

Texas

Lousiana

Oklahoma

Default

Switch

Texas

Lousiana

Oklahoma

Default

Strategies

Page 42: Techfest design patterns

King

Queen

Bishop

Rook

Knight

Pawn

how are they different?

Page 43: Techfest design patterns

Experiences with Strategy PatternWhere the Strategy Pattern can be found in .Net

Page 44: Techfest design patterns

REFACTOR

Page 45: Techfest design patterns

Factory Patternprovides an interface for creating families of related or dependent objects

Page 46: Techfest design patterns

Types of Factories

Factory Method

Factory Class

Abstract Factory

Page 47: Techfest design patterns

Experiences with Factory PatternWhere the Factory Pattern can be found in .Net

Page 48: Techfest design patterns

Other Patterns• Decorator• Mediator• Iterator• Builder• Composition• Visitor• Chain of Responsibility

Presentation Patterns• MVC• MVVM• MVP

Page 49: Techfest design patterns

Bookshelf

Page 50: Techfest design patterns

Questionshttp://tinyurl.com/htf2010-patterns

[email protected]@claudiolassalaEPS Software Corp

[email protected]

@rookieonewizardsofsmart.net

github.com/RookieOnebitbucket.org/rookieone

Chaione

Join us at www.VirtualBrownBag.com every Thursday 12pm -1pm