1 / 21

cf.OBJECTIVE (ANZ)

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

whitby
Download Presentation

cf.OBJECTIVE (ANZ)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. 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 About me OUTPUT 2500AD ORG 2000H MOV DX,0FFE6H MOV AX,82H OUT DX,AL NEXT:MOV AX,3000H MOV BX,0000H CALL DISP NOT AL MOV 3001H,AL MOV BX,0100H CALL DISP JMP SHORT NEXT DISP:PUSH AX MOV CX,1 CALL FAR 0FF00:0B12H POP AX RET END 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

  3. Your 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 About you

  4. Design Patterns by Example Template method Composite Design Patterns World Tour Architecture Software engineering Education Conclusion Motherhood statements Resources Questions Outline

  5. Simple See code sample - simple Example – form processing

  6. Let's componentize a bit... See code sample - simple.cfc Example – form processing

  7. Add some functionality: Support multiple forms on a page Detect incomplete form transmission See code sample - bettercfc Example – form processing

  8. Now refactor out some common functionality: See code sample - bettercfcrefactored Example – form processing

  9. A little less procedural, just for fun: See code sample - templatemethod Example – form processing

  10. if (isSubmitted() and validated()) { commit(); } Other ways to do this? Template method 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)

  11. OK, let's separate some concerns: See code sample - templatemethodrefactored Example – form processing

  12. More guts, more glory See code sample – composite Example – form processing

  13. 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); Composite

  14. Name Intent Context How it works Trade-offs What's a pattern?

  15. 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 And why should I care?

  16. 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. World tour - architecture

  17. GoF – Design Patterns Singleton Iterator Decorator Martin Fowler – PoEAA Front Controller Gateway Single Table Inheritance Gregor Hohpe – Enterprise Integration Patterns Message Endpoint Publish-Subscribe Channel Guaranteed Delivery World Tour – Software Engineering

  18. CIPL (my lot) Chunking & toggling Peer leader Hypothetical professionals E-LEN project Coherence principle Provide personal identity information World tour - education

  19. 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 Motherhood statements

  20. Books A Pattern Language: Towns, Buildings, Construction Christopher Alexander, Sara Ishikawa, Murry Silverstein ISBN 978-0195019193 Design Patterns: Elements of Reusable Object-Oriented Software Erich Gamma, Richard Helm, Ralph Johnson, John M. Vlissides ISBN 978-0201633610 Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions Gregor Hohpe & Bobby Woolf ISBN 978-0321200686 Patterns of Enterprise Application Architecture Martin Fowler ISBN 978-0321127426 Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development Craig Larman ISBN 978-013148906 Websites E-LEN http://www2.tisip.no/E-LEN/patterns_info.php Some patterns in the education field CIPL http://www.uq.edu.au/cipl No patterns here yet :( http://www.daimi.au.dk/~apaipi/workshop/nyartikel.pdf Article by Aino Corry on patterns vs language constructs. See also her talk on patterns in functional languages on InfoQ. Resources

  21. jmetcher@gmail.com http://lagod.id.au Argue!

More Related