E N D
1. Mach II and ColdSpring Kurt Wiersma
CF.Objective() 2006
kwiersma@jidev.com Ask how many people have used Mach II then ask if people have used ColdSpring.Ask how many people have used Mach II then ask if people have used ColdSpring.
2. Goals Show how Mach II and ColdSpring can be used together to build better enterprise grade applications.
Introducing a quick start application: Appbooster Using the Mach II and ColdSpring frameworks allows you to build robust enterprise web applications quickly.
Mach II - Model View Controller framework
ColdSpring - a container or factory that provides dependency injection for assembling and managing service objects, and more…
Enterprise environment - teams of developers building applications which need to have high availability and be easy to maintain over time as the business evolves.
Using the Mach II and ColdSpring frameworks allows you to build robust enterprise web applications quickly. In this session you will learn how to use these two frameworks to build an application that can grow as your business evolves. By using these two frameworks together you can get your team of developers to produce applications that are structured in a way that makes it easy for new developers to come up to speed on the application.
Introduce a sample application, Appbooster, built with best practices, that you can use as the basis for developing your next application
Consider revising to two main bullets (CS and M2) call this slide goalUsing the Mach II and ColdSpring frameworks allows you to build robust enterprise web applications quickly.
Mach II - Model View Controller framework
ColdSpring - a container or factory that provides dependency injection for assembling and managing service objects, and more…
Enterprise environment - teams of developers building applications which need to have high availability and be easy to maintain over time as the business evolves.
Using the Mach II and ColdSpring frameworks allows you to build robust enterprise web applications quickly. In this session you will learn how to use these two frameworks to build an application that can grow as your business evolves. By using these two frameworks together you can get your team of developers to produce applications that are structured in a way that makes it easy for new developers to come up to speed on the application.
Introduce a sample application, Appbooster, built with best practices, that you can use as the basis for developing your next application
Consider revising to two main bullets (CS and M2) call this slide goal
3. Introduction Mach II - Model View Controller framework
Doesn’t help you with your model
ColdSpring - is that like MN in March?
container for your model objects to make them available to your controllers Toy box with legos inside them (services)
AppBooster - sample/starter application which illustrates best practicesToy box with legos inside them (services)
AppBooster - sample/starter application which illustrates best practices
4. Typical App Architecture Domain/business objects for each entity in your system
Data Access objects (DAO) which read and save objects
Gateway objects which return queries
Service objects which manage the DAOs and gateways and call other services
Controllers which talk to the service layer to get the work done in an application. It is about layers!
Sean:
People places and things - domain objects
Services - concepts and processes It is about layers!
Sean:
People places and things - domain objects
Services - concepts and processes
5. ColdSpring Part 1 ColdSpring's core focus is to make the configuration and dependencies of your CFCs easier to manage. Typically this is necessary in the service layer of your application.
ColdSpring consists of a container which can create and maintain any object (aka bean). Within that container the following features are provided:
Dependency Injection
IOC - The “Hollywood Principle” - don’t call me I will call you
Auto-wiring of dependencies to save you some configuration
By default all objects are singletons and are cached in the application scope. You can override this on a per object basis ColdSpring is a inversion-of-control framework/container for CFCs (ColdFusion Components). Inversion of Control, or IoC, is synonymous with Dependency Injection, or DI. Dependency Injection is an easier term to understand because it’s a more accurate description of what ColdSpring does. ColdSpring borrows its XML syntax from the java-based Spring Framework, but ColdSpring is not necessarily a “port” of Spring.
A dependency is when one piece of a program depends on another to get its job done. ColdSpring is a inversion-of-control framework/container for CFCs (ColdFusion Components). Inversion of Control, or IoC, is synonymous with Dependency Injection, or DI. Dependency Injection is an easier term to understand because it’s a more accurate description of what ColdSpring does. ColdSpring borrows its XML syntax from the java-based Spring Framework, but ColdSpring is not necessarily a “port” of Spring.
A dependency is when one piece of a program depends on another to get its job done.
6. ColdSpring Part 2 Also part of ColdSpring is the first Aspect-Oriented-Programming (AOP) framework for CFCs. See Chris Scott’s presentation for more information on this powerful feature.
Flash Remoting utilities which provide support for mapping CFCs to ActionScript classes and visa versa.
Support for integrating with your old factories through the factory-method attribute.
7. ColdSpring Configuration
8. Mach II & ColdSpring A Killer Combo ColdSpring provides Mach II and ModelGlue plug-ins for easy integration
ColdSpring can auto-wire your Mach II listeners to any objects in the ColdSpring container.
ColdSpring then serves as the factory or service locator for the listeners
9. Mach II - Without ColdSpring Listeners created services
DSN hard coded into the services
DAOs and Gateways hard coded into the services Flow of execution with Mach II and CS. Get people involved. Consider talking about CS first.
Show a before and after example with M2 and CS.
Event based framework where you define event handlers in an XML config file
You write CFC based listeners (controllers) which extend MachII.framework.Listener in order to process requests and communicate with your model.
The Event object is used to pass data from your listeners to your views. It acts simply as a container
Can be extended through the use of filters (per event) and plug-ins (application wide)
Flow of execution with Mach II and CS. Get people involved. Consider talking about CS first.
Show a before and after example with M2 and CS.
Event based framework where you define event handlers in an XML config file
You write CFC based listeners (controllers) which extend MachII.framework.Listener in order to process requests and communicate with your model.
The Event object is used to pass data from your listeners to your views. It acts simply as a container
Can be extended through the use of filters (per event) and plug-ins (application wide)
10. Mach II With ColdSpring Listeners injected with services
DSN injected into DAOs and Gateways by ColdSpring Show CS plugin configShow CS plugin config
11. But that is a lot of configuration isn’t it? Enterprise applications
Use a code generator to help you
Enterprise applications
Use a code generator to help you
12. Introducing AppBooster A sample Mach II and ColdSpring application developed with best practices.
You can use AppBooster to give your application a jump start much like Mach II’s App Skeleton
Provides a simple model for users, addresses, and roles
User authentication is implemented
There is both a public and admin interface for managing users Show flow of request for a appbooster going through CS and M2.Show flow of request for a appbooster going through CS and M2.
13. AppBooster Model
14. Recommendations Do a proof of concept
You don’t have to do it all at once
Consider developing or using a code generator or framework to speed development
Favor setter injection over constructor injection when setting up your services
Join the Mach II and ColdSpring mailing lists
15. Tools For Enterprise Development CFEclipse
CFCDoc
UML Tools
Visio (Windows)
OmniGraffle (OS X)
Poseidon UML (Java)
Peter Farrell’s Bean generator Rooibos
Crudgen
16. Resources Mach II
Mach II Dev Guide
Mach-ii.info
Peter Farrell’s Mach II FAQs
ColdSpring
Chris Scott’s Blog
Dave Ross’s blog
Kurt’s Blog
AppBooster
17. Questions?? Fire away…