design principles - michael denomy at launch academy

Post on 20-Jun-2015

1.223 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

In this talk I gave at Launch Academy, a developer boot-camp in Boston, I go over some key design principles. I introduce the SOLID design principles, focusing on Single Responsibility and Dependency Inversion, as well as talk about Incremental Design

TRANSCRIPT

Design PrinciplesIncremental Design, Single Responsibility,

and Dependency Inversion

Michael DenomySeptember 19, 2013Launch Academy, Boston MA

Sunday, September 22, 13

About MeTech Lead at Cyrus Innovation

Passionate about Agile and XPPairingTDDIncremental Design

Contact Me@mdenomy on Twitter and GitHubhttp://mdenomy.wordpress.com/

Sunday, September 22, 13

SOLID Design PrinciplesSet of principles identified by Bob Martin, aka Uncle Bob- Somewhere in the 1995-2000 timeframe- Uncle Bob has some strong opinions on

software, you should check them out

Sunday, September 22, 13

SOLID Design PrinciplesS Single ResponsibilityO Open-Closed L Liskov SubstitutionI Interface SegregationD Dependency Inversion not Dependency Injection

Sunday, September 22, 13

SOLID Design PrinciplesS Single ResponsibilityD Dependency Inversion not Dependency Injection

That’s plenty for today

Sunday, September 22, 13

Single ResponsibilityOfficial Definition- A class should have only one reason to

change

What It Means To You- Keep your classes small- Don’t mix responsibilities- CheckingAccount manages balance and

calculates fees

Sunday, September 22, 13

Dependency InversionOfficial Definition- Depend on abstractions not concretions

What It Means To You- Your class should not know the details of its

dependencies, just the interfaces- Ideally both ends of the dependency

relationship deal with abstractions, i.e. interfaces- Dependency injection is a way to implement

dependency inversion

Sunday, September 22, 13

Incremental DesignAlways Be DesigningPay attention to “code smells”The simplest thing that worksRed-Green-Refactor

not Red-Green-Red-Green-Red-Green-Refactor-Refactor-Refactor-Refactor-Refactor

You will never know less than you know now

- Sandi Metz, Practical OOD in Ruby (POODR)

Sunday, September 22, 13

Let’s Look at Some CodeReally Simple Example of a CheckingAccount

Work in small increments

Learn about the problem as we go

Listen for code smells

https://github.com/mdenomy/intro-design-workshopNote:Readme contains design thoughts as I go

Sunday, September 22, 13

Take-AwaysWork small

Pay attention to design trade-offs, technical debt, and naming

Be students of your craftProcesses, frameworks, tools, everything

Challenge your assumptionsJust cause it’s the “right” way today...

Sunday, September 22, 13

ReferencesBob Martin (Uncle Bob) on SOLIDhttp://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod

Sandi Metz - SOLID Talk at GORUCOhttp://www.confreaks.com/videos/240-goruco2009-solid-object-oriented-design

Derick Bailey - Los Techieshttp://lostechies.com/derickbailey/2011/09/22/dependency-injection-is-not-the-same-as-the-dependency-inversion-principle/

James Shore - Art of Agilehttp://www.jamesshore.com/Agile-Book/incremental_design.html

Sunday, September 22, 13

Thank YouQ&A

Sunday, September 22, 13

Design PrinciplesIncremental Design, Single Responsibility,

and Dependency Inversion

Michael DenomySeptember 19, 2013Launch Academy

Sunday, September 22, 13

top related