Comparing Application Frameworks (BACFUG 2009-04-15)

Comments

There aren't any comments for this presentation.

Add Comment

Comments have been closed.

Transcript

no image

Slide Text

Slide Notes


Slide 1


BACFUG
April 15th, 2009

no notes exist for this slide

Slide 2


Agenda
Welcome!
Announcements!
Sponsors!
Featured Presentation (yeah, me!)
Q&A
Raffle

no notes exist for this slide

Slide 3


Welcome!
Tonight's topic:
ColdBox? Mach-II? Model-Glue?
Sean Corfield
Next meeting: May 20th
What's New in Mach-II?
Kurt Wiersma (remote via Connect)

no notes exist for this slide

Slide 4


Announcements!
Anyone hiring?
Anyone looking for work?
Any other announcements?

no notes exist for this slide

Slide 5


Announcements!
Sean Corfield is joining Railo US!

no notes exist for this slide

Slide 6


Announcements!
Sid Maestre is the new BACFUG manager

no notes exist for this slide

Slide 7


Sponsors!
Sid for the beer!
Anonymous for the pizza!
Planitax for hosting our meeting!

no notes exist for this slide

Slide 8


Presentation!
ColdBox? Mach-II? Model-Glue?
Sean Corfield

no notes exist for this slide

Slide 9


Which Framework?
Sean Corfield, Railo

no notes exist for this slide

Slide 10


Who am I?
Consultant, Railo, Inc.
Adobe Community Expert for ColdFusion
Manager of BACFUG
Formerly Sr Architect for Macromedia IT
CFML developer since 2001 ("Neo")
Java dev (since '97) and C++ (since '92)
Flex / AIR / Groovy (since '08)

no notes exist for this slide

Slide 11


What we'll cover
Structure of frameworks
ColdBox, Mach-II, Model-Glue
What do they have in common?
How are they different?
Show & Tell!

no notes exist for this slide

Slide 12


Structure of frameworks

no notes exist for this slide

Slide 13


Traditional Applications
Display code
Link to page / form submit to page
Validation / data processing in page or ad hoc includes / CFCs
Logic to select next page

no notes exist for this slide

Slide 14


Traditional Applications
<cfif isDefined("form.submit")>
... process data ...
... redirect or continue to show errors ...
</cfif>
<cfform ..>
...
</cfform>

no notes exist for this slide

Slide 15


Model-View-Controller
View = display code
Controller = logic to select next page, form validation, interaction with Model
Model = all the business logic - validation, data processing etc

no notes exist for this slide

Slide 16


Model-View-Controller
All requests go through the Controller
It writes to the Model and reads data back from the Model
It selects the View to render
Views may read from the Model (or data provided by the Controller)

no notes exist for this slide

Slide 17


Types of framework
MVC - application frameworks
cfWheels, ColdBox, Fusebox, Mach-II, Model-Glue, onTap etc
ORM - persistence frameworks
DataFaucet, Hibernate (Java), Reactor, Transfer etc

no notes exist for this slide

Slide 18


Types of framework
IoC / DI - management of services (CFCs)
ColdSpring, Lightwire, Spring (Java)
Miscellaneous
Validation frameworks
Event handling frameworks
etc

no notes exist for this slide

Slide 19


What do they all have in common?

no notes exist for this slide

Slide 20


Commonalities
What do ColdBox, Mach-II and Model-Glue have in common?
More than you might think!

no notes exist for this slide

Slide 21


Commonalities
index.cfm - entry point for Controller (the framework plus your CFCs together)
event-based - focused on "handlers"
event "object"
Contains URL and form data
Provides a data bus for Controller / View

no notes exist for this slide

Slide 22


Commonalities
URL and form scope are blended together
Views are "regular" CFML pages
Controllers are CFCs
Model is a collection of CFCs too

no notes exist for this slide

Slide 23


Configuration vs Convention
Event handlers are specified in XML files
Mach-II, Model-Glue - like Fusebox XML
Event handlers are located by convention
ColdBox - like Fusebox no-XML

no notes exist for this slide

Slide 24


How are they different?

no notes exist for this slide

Slide 25


ColdBox

no notes exist for this slide

Slide 26


ColdBox
Event names look like entity.action
Map to handler entity.cfc, method action(event) - like Fusebox no-XML
Default view would be entity/action.cfm
Handler can set a different view
e.g., user.list -> user.cfc:list() -> user/list.cfm

no notes exist for this slide

Slide 27


ColdBox
Core configuration is via XML file
Just basic properties - no "logic"
Layouts
Default layout for whole app
Default layout for specific views/folders
Can override programmatically

no notes exist for this slide

Slide 28


ColdBox
Interceptors - called automatically during the application / request lifecycle
SES URLs, security, tracing, cache advice...
e.g., environment interceptor can override configuration for dev, QA, prod

no notes exist for this slide

Slide 29


ColdBox
Plugins - add custom functionality
Create plugins/Stuff.cfc
In view or handler, getMyPlugin("Stuff")
Automatically cached
Lots built-in: i18n, logger, RSS, web services, timer etc

no notes exist for this slide

Slide 30


ColdBox
Incredible documentation!
It's a very rich framework with a lot of functionality but it's also very easy to get started

no notes exist for this slide

Slide 31


Mach-II

no notes exist for this slide

Slide 32


Mach-II
Event handlers in XML
Call methods on listener CFCs
Specify views to render
Can publish message for subscribed listeners
Can map event names
Both decouple listeners from XML

no notes exist for this slide

Slide 33


Mach-II
XML also defines
Modules - to decompose large apps
Subroutines - reusable handler "logic"
Properties - simple and complex
e.g., ColdspringProperty CFC
Can be like plugins in ColdBox

no notes exist for this slide

Slide 34


Mach-II
Plugins - a bit like interceptors in ColdBox
Automatically called during each request
Filters - conditional logic for event handlers
Can change flow of events
Built-in caching, logging (as of 1.6)

no notes exist for this slide

Slide 35


Mach-II
Environment support (coming in 1.8)
Conditional configuration based on dev, QA, prod server groups
HTML helper (coming in 1.8)
Reduces clutter in views by encapsulating boilerplate code and common operations

no notes exist for this slide

Slide 36


Mach-II
Reasonable documentation
Strong, consistent architecture
Very "OO" which can be a barrier for some

no notes exist for this slide

Slide 37


Model-Glue

no notes exist for this slide

Slide 38


Model-Glue
Event handlers in XML
Publish messages for subscribed listeners
Specify conditional result / event mapping
Specify views to render

no notes exist for this slide

Slide 39


Model-Glue
Controller CFCs (methods are listeners)
Conditional logic sets "results" to control the flow of events (like filters in Mach-II)
A few automatic events during each request (like plugins in Mach-II or interceptors in ColdBox)

no notes exist for this slide

Slide 40


Model-Glue
Scaffolding (MG2) / code generation (MG3)
Builds XML, controllers and views for you to speed up development
Event types (new in MG3)
Reduces boilerplate layout / result mapping in event handler XML

no notes exist for this slide

Slide 41


Model-Glue
Integrated ColdSpring
Autowiring of model into controllers
Model-Glue itself is wired together with ColdSpring!

no notes exist for this slide

Slide 42


Model-Glue
View formats (new in MG3)
Select different views in single event handler to render HTML or XML or ...

no notes exist for this slide

Slide 43


Model-Glue
Very simple, clean architecture
Aimed at CFers (even tho' it is OO)
Poor documentation :(

no notes exist for this slide

Slide 44


Show & Tell!

no notes exist for this slide

Slide 45


Let's see some code!
I'm going to install each framework and then we can have a look at a small sample application with each one

no notes exist for this slide

Slide 46


Wrap up...
At a high level, ColdBox, Mach-II and Model-Glue perform similar functions
ColdBox has convention-based approach
Model-Glue is lightweight and simple
Mach-II is very OO and built for extension

no notes exist for this slide

Slide 47


Q&A
sean@corfield.org
sean@getrailo.com
http://corfield.org/
http://getrailo.com/

no notes exist for this slide

Slide 48


Raffle
Includes: Webucator Online Training

no notes exist for this slide