cf.objective (anz)

21
cf.OBJECTIVE(ANZ) Design Patterns and Form Processing Jaime Metcher Software Architect, Centre for Innovation in Professional Learning, University of Queensland

Upload: whitby

Post on 15-Jan-2016

50 views

Category:

Documents


0 download

DESCRIPTION

Design Patterns and Form Processing Jaime Metcher Software Architect, Centre for Innovation in Professional Learning, University of Queensland. cf.OBJECTIVE (ANZ). B.Sc (maths) Aerial survey software (in the 80's!) Kids LAN wrangler at UQ Coldfusioneer at Med-E-Serv - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: cf.OBJECTIVE (ANZ)

cf.OBJECTIVE(ANZ)

Design Patterns and Form ProcessingJaime Metcher

Software Architect, Centre for Innovation in Professional Learning, University of Queensland

Page 2: cf.OBJECTIVE (ANZ)

About me

B.Sc (maths)

Aerial survey software (in the 80's!)

Kids

LAN wrangler at UQ

Coldfusioneer at Med-E-Serv

Archi-thingie back at UQ

B.Sc (maths)

Aerial survey software (in the 80's!)

Kids

LAN wrangler at UQ

Coldfusioneer at Med-E-Serv

Archi-thingie back at UQ

OUTPUT 2500ADORG 2000HMOV DX,0FFE6HMOV AX,82HOUT DX,ALNEXT:MOV AX,3000HMOV BX,0000HCALL DISPNOT ALMOV 3001H,ALMOV BX,0100HCALL DISPJMP SHORT NEXTDISP:PUSH AXMOV CX,1CALL FAR 0FF00:0B12HPOP AXRETEND

Page 3: cf.OBJECTIVE (ANZ)

About youYour team lead is bugging you

You are the team lead and you want to bug your juniors:

What do you do that's so great?How do you teach that?

You want to pad your CV

You know all about patterns and you're here to heckle

You thought this was the Railo talk

Page 4: cf.OBJECTIVE (ANZ)

OutlineDesign Patterns by Example

Template methodComposite

Design Patterns World TourArchitectureSoftware engineeringEducation

ConclusionMotherhood statementsResourcesQuestions

Page 5: cf.OBJECTIVE (ANZ)

Example – form processing

SimpleSee code sample - simple

Page 6: cf.OBJECTIVE (ANZ)

Example – form processing

Let's componentize a bit...See code sample - simple.cfc

Page 7: cf.OBJECTIVE (ANZ)

Example – form processing

Add some functionality:Support multiple forms on a pageDetect incomplete form transmission

See code sample - bettercfc

Page 8: cf.OBJECTIVE (ANZ)

Example – form processing

Now refactor out some common functionality:See code sample - bettercfcrefactored

Page 9: cf.OBJECTIVE (ANZ)

Example – form processing

A little less procedural, just for fun:See code sample - templatemethod

Page 10: cf.OBJECTIVE (ANZ)

Template method

if (isSubmitted() and validated()) {

commit();

}

Other ways to do this?

Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.- Design Patterns: Gamma et al. (aka GoF)

Page 11: cf.OBJECTIVE (ANZ)

Example – form processing

OK, let's separate some concerns:See code sample - templatemethodrefactored

Page 12: cf.OBJECTIVE (ANZ)

Example – form processing

More guts, more glorySee code sample – composite

Page 13: cf.OBJECTIVE (ANZ)

Composite

Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly

- Design Patterns: Gamma et al. (aka GoF)

myCompositeFormGuts = CreateObject("component", "compositeFormGuts").init("puttin_it_togetha");

myCompositeFormGuts.addChild(myFormGuts1);myCompositeFormGuts.addChild(myFormGuts2);

Page 14: cf.OBJECTIVE (ANZ)

What's a pattern?

NameIntent

ContextHow it works

Trade-offs

Page 15: cf.OBJECTIVE (ANZ)

And why should I care?

Prevent 'defactoring'“Hey, I noticed there was this totally unnecessary inheritance lying around so I

refactored it out”

Communication“Why do we have this one crazy class that has the same interface as all the

others but is completely different under the hood?”

Education

Page 16: cf.OBJECTIVE (ANZ)

World tour - architecture

Alexander's “A Pattern Language” - read it!

Light on two sides:When they have a choice, people will always gravitate to those rooms which

have light on two sides, and leave the rooms which are lit only from one side unused and empty.

Therefore:

Locate each room so that it has outdoor space outside it on at least two sides, and then place windows in these outdoor walls so that natural light falls into

every room from more than one direction.

Page 17: cf.OBJECTIVE (ANZ)

World Tour – Software Engineering

GoF – Design PatternsSingletonIterator

Decorator

Martin Fowler – PoEAAFront Controller

GatewaySingle Table Inheritance

Gregor Hohpe – Enterprise Integration PatternsMessage Endpoint

Publish-Subscribe ChannelGuaranteed Delivery

Page 18: cf.OBJECTIVE (ANZ)

World tour - education

CIPL (my lot)Chunking & toggling

Peer leaderHypothetical professionals

E-LEN projectCoherence principle

Provide personal identity information

Page 19: cf.OBJECTIVE (ANZ)

Motherhood statements

Patterns are primarily about communication

Patterns are not templates or rules

Pattern use is all about professional judgement

A pattern by definition is not new

Page 20: cf.OBJECTIVE (ANZ)

Resources

Books

A Pattern Language: Towns, Buildings, ConstructionChristopher Alexander, Sara Ishikawa, Murry SilversteinISBN 978-0195019193

Design Patterns: Elements of Reusable Object-Oriented SoftwareErich Gamma, Richard Helm, Ralph Johnson, John M. VlissidesISBN 978-0201633610

Enterprise Integration Patterns: Designing, Building, and Deploying Messaging SolutionsGregor Hohpe & Bobby WoolfISBN 978-0321200686

Patterns of Enterprise Application ArchitectureMartin FowlerISBN 978-0321127426

Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative DevelopmentCraig LarmanISBN 978-013148906

Websites

E-LEN http://www2.tisip.no/E-LEN/patterns_info.phpSome patterns in the education field

CIPL http://www.uq.edu.au/ciplNo patterns here yet :(

http://www.daimi.au.dk/~apaipi/workshop/nyartikel.pdfArticle by Aino Corry on patterns vs language constructs. See also her talk on patterns in functional languages on InfoQ.

Page 21: cf.OBJECTIVE (ANZ)

Argue!

[email protected]

http://lagod.id.au