ColdFusion Weekly Version 1.10 - May 29, 2006
Version 1.10 - May 29, 2006
Safari Edition
Introduction & Comments
- What Matt has been up to - move to high-availability environment, MachBlog, and getting water in his iRiver H10 20GB
- What Peter has been up to - discussion with Chris Scott about the factory bean functionality in ColdSpring
CFReport - at 9:14
- Making progress on Mach-II 1.1.1, big plans for brand-new web site and documentation
- Reactor - SVN respository moved, now has access via HTTP; also Trac site up
- One Click Installer for Subversion
- Dave Shuck has Eclipse snippets he created based on a blog post by Aaron Lynch that will restart the CF service right from within Eclipse (type restart[ctrl][shift][period])
- Massimo Foti - Spry + CF demo photo gallery
- Rob Rohan - AFAE (Another Freebooter's All-purpose Editor) - collection of plugins for Eclipse; includes a while-you-edit XML compiler with Mach-II support!
- Ray Camden - "Creating a mailing list in CF" series
- Breeze presentation on FarCry by Geoff Bowers - even has timings so you can skip to the stuff you're most interested in!
- Cooqy: OpenLaszlo-powered eBay front-end
- ajaxCFC update for BlueDragon compatibility; also news of Mach-II integration being done by Dan Wilson
- Sean Corfield's Mach-II (well, general OO) advice - use a service layer
Design Pattern Safari - at 21:50
- Beginning Our Journey -- What we want to accomplish...
- Code examples avaiable on our website so you can see what we're talking about
- Our Journey Down the Objectazon River: What's a design pattern?
- A design pattern is a general and repeatable solution to a commonly occurring problem
- A design pattern is not code, but a structure or blueprint to implement your code by
- A design pattern is not an alogrithm since alogrithms solve computational problems
- Why Patterns Are Important...
- Patterns provide a "standardized" vocabulary for developers to communicate using well-known, well understood names for software interactions
- Design patterns can easily be improved over time, making them more robust than ad-hoc designs
- Patterns are about extensibility and reusability
- Comon Indentifications In the Jungle: Design Patterns You''ll Use Daily in ColdFusion
- Beans (Also known as Business Objects or Value Objects)
- DAOs (Stands for Data Access Objects)
- Gateways (Stands for Data Gateway Objects)
- Services (Also known as Manager Objects)
- Our first animal: The Bean
- Typically represents a specific entity in your model
- Carries "encapsulated" data between the different layers of your application
- Sorta like a glorified structure, however instead of directly accessing data with a key you call a method
- Helps you organize your data structures instead passing structures around ad-hoc
- Has a consistent and simple interface (Controllable API)
- Has methods called getters/setters (aka accessors) to access data [getFirstName() / setFirstName()]
- Might be composed of other beans
- Easily created with a code generator
- Carries "encapsulated" data between the different layers of your application
- Next Stop: DAO (data access object)
- DAOs only interact with one row of data via the primary key
- Used to save/load objects from data storage
- A DAO could interface with: Database / Legacy persistent data storage (XML / Text File)
- Peter's' DAOs usually have ScRuD method that take a bean (ScRuD - Save | (create) | Read | (update) | Delete)
- Another beast: Gateways (Your Access to All Things Aggregated)
- Contains method that sql (select) queries that return one or more rows of data
- Typically returns a cfquery object
- Rarely it can return a bean (Querying by User/Pwd)
- Performs functionality that may affect one or more rows
- Services: Kings of the Jungles
- Contains your business logic:
- Bean Validation / Creation
- Application specific business logic
- Save / Load / Delete from DAO (via the facade pattern)
- Gateway Interaction (via the facade pattern)
- Usually depends on a DAO and Gateway
- Services can comsume other services
- Contains your business logic:
- Diagram of how it all works together - Thank you for Kurt Wiersma
- Others Notable Stops in the Wild
- Facade: Provides a simplified interface to a larger body of code
- Controllers: These are very framework specific. Recommend looking at Fusebox, Mach-II or Model-Glue
- Singletons: An object that only has one instance during the lifetime of the application
- Surviving: Obey Your Suvival Instincts
- Do...
- use them as you go and understand more of the problem
- focus on your needs
- learn that when they have a particular kind of problem or smell - go to your pattern toolbox to find a solution
- understand that some patterns have tradeoffs
- understand that you can only appreciate a pattern once it has solved a painful problem for you
- Do not...
- start immediately throwing patterns into a design
- have to use all the patterns we've discussed
- Do...
- Studying to Become a Safari Guide
- Code Generation - Rooibos Generator
- Object Management - ColdSpring
- Focuses on making configuration and dependencies of your objects (CFCs) easier to manage.
- ColdSpring uses the "inversion-of-control" pattern to "wire" your CFCs together.
- Object Technology: A Manager's Guide
- David A. Taylor
- Addison-Wesley Professional &dnash; 0201309947
- Design Patterns Explained: A New Perspective on Object-Oriented Design
- Alan Shalloway & James Trott
- Addison-Wesley Professional &dnash; 0321247140
- Head First Design Patterns
- Freeman, Freeman, Bates & Sierra
- O'Reilly Media - 0596007124
- CFC-Dev mailing list: Join at cfczone.org
CF_HotSeat
No Hotseat in lieu of the safari discussion...
CF_Quiz - at 1:01:57
Wrap Up - at 1:05:37
CFExit - at 1:06:18
"I'll Find Mine" by J.R. Byrd
