Design Patterns and ColdFusion: Exploring Object Based Programming - PowerPoint PPT Presentation

About This Presentation
Title:

Design Patterns and ColdFusion: Exploring Object Based Programming

Description:

An Architect does not construct a building with out a blueprint, ... short, design patterns provide a foundational blueprint for software development. ... – PowerPoint PPT presentation

Number of Views:117
Avg rating:3.0/5.0
Slides: 27
Provided by: Rae24
Category:

less

Transcript and Presenter's Notes

Title: Design Patterns and ColdFusion: Exploring Object Based Programming


1
Design Patterns and ColdFusion Exploring Object
Based Programming
  • Dan Blackman
  • www.muddbrick.com

2
Dan Blackman
  • Founder and Senior Consultant
  • Mudd Brick Inc, Dallas, Tx
  • Certified Adobe Instructor Flex, ColdFusion,
    Flash
  • Experience 12 Years ColdFusion, Flash and Flex

3
Setting Expectations
  • I am not a Architect but I play one on TV
  • My name does not end in Lehman, Forta, Majano
    etc.
  • There will be NO debate here todayJust
    demystification of a cryptic topic.
  • Lets have an interactive dialog

4
Objectives
  • Design Patterns The Why?
  • Identification of Core Design Patterns
  • Frameworks
  • Shut up and Show me some code!!!
  • Summary and Questions

5
Design Patterns The Why!?
  • What is the main goal of building ColdFusion/
    Flex Applications?

6
Design Patterns The Why?
SOA Service Oriented Architecture
Mind the Gap - Marcel Boucher http//blogs.adobe.
com/mtg/2008/04/implementing_soa_principals_in.htm
l
Duane Nickul, et al http//www.adobe.com/enterpri
se/pdfs/Services_Oriented_Architecture_from_Adobe.
pdf
7
Design Patterns The Why?
SOA Service Oriented Architecture
The ultimate value of SOA is the ability to
combine automated business services to create new
market offerings that may reduce time-to-market
and development costs." Terry Borden and
Bill Mitlehner
8
Design Patterns The Why?
SOA
9
Design Patterns The Why?
  • FACT Refactoring patterns into existing code is
    much more difficult than writing an application
    correctly the first time.

10
Design Patterns The Why
  • Scalability Can your application support a
    large number of concurrent users?
  • Maintainability the everyday fight we have with
    our inner-self and management.
  • Reusability Break down your application into
    small chunks. Forces us to build structure into
    our applications.

11
Design Patterns The Why
Lets look at some Spaghetti CodeMost of you
have written code like this!!!
12
Design Patterns The Why
MORAL of the STORY?
An Architect does not construct a building with
out a blueprint, Why are YOU then, building
applications without a solid foundation? Me
13
Identification of Core Design Patterns
  • What are design patterns and how do I use them?

14
Identification of Core Design Patterns
  • Design Pattern Definition
  • design pattern is a general reusable solution to
    a
  • commonly occurring problem in software design. A
  • design pattern is not a finished design that can
    be
  • transformed directly into code.
  • In short, design patterns provide a foundational
    blueprint for software development.
  • Patterns are NOT code, they are designs we apply
    to our application code.

15
Identification of Core Design Patterns
  • Core Patterns
  • MVC Design Pattern
  • Singleton Pattern Application.cfc
  • Service Object Pattern
  • Front Controller/ Command Patterns
  • Business Delegate Pattern
  • DAO/ Gateway Patterns
  • Value/ Data Transfer Object Pattern

16
Identification of Core Design Patterns
17
Identification of Core Design Patterns
  • Model View Controller
  • Allows for a clear separation between User
    Interface Objects and the underlying data model
  • Elements of MVC include
  • Model, which manages data elements and responds
    to queries
  • about its state and to instructions to change
    its state
  • View, which manages a rectangular area of the
    display and is
  • responsible for presenting the data
  • Controller, which handles events from the user
    and system that
  • affect the model and view
  • These application components allow the separation
    of the following
  • User interaction
  • Modeling of the external world (data)
  • Visual feedback to the user

18
Identification of Core Design Patterns
  • Singleton Design Pattern
  • Used to restrict the instantiation of a class to
    a single instance.
  • Application.cfc - OnApplicationStart

19
Identification of Core Design Patterns
  • Service Objects
  • Allows Encapsulation of Business Logic in a
    single service interface.
  • LoginService.cfc
  • EmailService.cfc
  • ZipValidationService.cfc

20
Identification of Core Design Patterns
  • Front Controller/ Command Patterns
  • The Front Controller is a single component
    created to handle all system requests.
  • Controls and coordinates processing of each user
    across multiple requests.
  • Employs Command (workers) in order to carry out
    requests.
  • Commands can be reused throughout the application
    across multiple Views

21
Identification of Core Design Patterns
  • Business Delegate Pattern
  • A simple class that acts to create separation
    between the Presentation/ Web tier client (HTML/
    RIA) and the business tier on the back-end.
  • Provides remote access from Web clients to
    important business tier services.

22
Identification of Core Design Patterns
  • DAO/ Gateway Patterns
  • DAO Data Access Object Provides CRUD
    operation methods for specific business objects.
  • Table Data Gateway (Fowler) Provides a similar
    set of data access methods. Commonly used in
    ColdFusion applications for bulk data access.
    (i.e. queries that return large data sets)

23
Identification of Core Design Patterns
  • Data Transfer / Value Objects
  • Also called beans, this pattern provides a way
    to transfer data back and forth to the Web Client
    tier
  • Value Objects are NOT packaged exactly like
    Database tabels
  • Designed using a UML Class diagram

24
Frameworks
  • Various Frameworks implement design patterns
  • ColdFusion
  • ColdBox
  • Mach-II
  • Model-Glue
  • ColdSpring
  • Flex
  • Pure MVC
  • Cairngorm
  • Model-Glue
  • Swiz
  • Mate

25
Shut up and show me some code!!!
  • When building an application, where do you start?
  • View ? Controller ? Model?
  • Model ? Controller ? View
  • You have a database Where do I go from here!?
  • Lets check out a real scenario!

26
Questions?Dan BlackmanMudd Brick Inc.Dallas,
TXdblackman_at_muddbrick.com
Write a Comment
User Comments (0)
About PowerShow.com