Slide 1
Building ColdFusion Apps with Framework One
By Javier Julio
no notes exist for this slide
Slide 2
About Me
Javier Julio
Flex Developer for Arc90
Cool Arc90 projects (bookmarklets)
Readability - Makes noisy posts or articles readable
TBUZZ - Easily tweet the page youâre visiting
Started off with ColdFusion development
Flex and AIR development using PureMVC
www.javier-julio.com
no notes exist for this slide
Slide 3
What is Framework One?
FW/1 created by Sean Corfield
A simple MVC framework with 1 core file
Completely convention based
No XML configuration
Based on Application.cfc
Going back to basics
no notes exist for this slide
Slide 4
What is MVC?
A software development architectural pattern
The separation of tasks into 3 distinct layers:
Model - data handling and structure
Controller - business logic
View - rendering data to the client
Helps achieve:
Clarity
Maintainability
Reusability
Teamwork
no notes exist for this slide
Slide 5
Basic Application Structure
Must have Application.cfc
Must extend org.corfield.framework
An empty index.cfm at the application root
Contain the following folders:
views
layouts
controllers
services
no notes exist for this slide
Slide 6
Actions, Sections and Items
Action consists of a section and item
A section is an entity or grouping
An item is a task within that section
Examples:
index.cfm?action=user.list
index.cfm?action=category.save
Search engine safe URLs are supported
index.cfm/user/list/
no notes exist for this slide
Slide 7
Views
The views folder
Contains subfolders for each section
Each subfolder contains individual view files
Full pages or page fragments
All files and folders must be in all lowercase!
no notes exist for this slide
Slide 8
Demo
Hello1 Demo Application
no notes exist for this slide
Slide 9
Layouts
Introduce as needed
The layouts folder
May contain subfolders for sections
Subfolders may contain layouts for specific views
Provided a variable named body
Generated output that the layout should wrap
All files and folders must be in all lowercase!
no notes exist for this slide
Slide 10
Demo
Hello2 Demo Application
no notes exist for this slide
Slide 11
Layouts
A request can have 3 layouts executed
FW/1 looks for layouts in the following places:
layouts/section/item.cfm
layouts/section.cfm
layouts/default.cfm
Stopping the layout cascade
set request.layout = false
Helpful for returning XML/JSON or AJAX calls
no notes exist for this slide
Slide 12
Views and Layouts
Executed by being included in framework CFC
Exercise caution!
Technically have access to all framework methods
Just because you can doesnât mean you should
Every view and layout provided a local struct
no notes exist for this slide
Slide 13
The Request Context
All views/layouts given variable named rc
This is the request.context struct
Contains URL and form variables merged together
Request context passed elsewhere too
Controller methods receive an rc argument
Service methods receive as argument collection
Declared arguments match against values in rc
no notes exist for this slide
Slide 14
Controllers and Services
Introduce as needed
The controllers and services folder
May contain a CFC for each section
Each CFC contains a method for each item
All files and folders must be in all lowercase!
Caution: Cached in FW/1âs application cache!
e.g. declare local variables using var
no notes exist for this slide
Slide 15
Demo
Hello3 Demo Application
no notes exist for this slide
Slide 16
Methods Called
Called by FW1 when asked for section.item:
controllers/section.cfc:before()
controllers/section.cfc:startItem()
controllers/section.cfc:item()
services/section.cfc:item()
return value stored in rc.data
additional service calls added via service() API
controllers/section.cfc:endItem()
controllers/section.cfc:after()
no notes exist for this slide
Slide 17
Controllers and FW/1 API
If FW/1 API access is required in a controller
Define init() method
With single argument of type any
FW/1 passes itself
API methods:
service(action, key)
populate(bean, keyListToPopulate)
redirect(action, preserve, append)
no notes exist for this slide
Slide 18
Configuration
All config is in a simple structure in Application.cfc
variables.framework
action = âactionâ
defaultSection = âmainâ
defaultItem = âdefaultâ
reload = âreloadâ
password = âtrueâ
For more information
no notes exist for this slide
Slide 19
Application, Session and Request Variables
Easiest/safest way is to override following methods:
setupApplication()
setupSession()
setupRequest()
FW/1 calls each from the appropriate method
onApplicationStart(), etc.
no notes exist for this slide
Slide 20
Bean Factories
Supports any bean factory (IoC Container or DI factory) with the following API:
containsBean(name)
returns true if factory knows of named bean
getBean(name)
returns fully initialized bean identified by name
IoC - Inversion of Control
DI - Dependency Injection
no notes exist for this slide
Slide 21
Demo
UserManager Demo Application
UserManagerAJAX Demo Application
no notes exist for this slide
Slide 22
Subsystems
Drop an FW/1 app into an existing one
Used as modules with no parent app dependencies
Must enable in parent applicationâs Application.cfc
variables.framework
usingSubsystems = true
FW/1 Examples can be run standalone or as subsystems in another application
no notes exist for this slide
Slide 23
Documentation and Resources
Mailing List (Google Groups)
Hosted on RIA Forge: fw1.riaforge.org
Blog
Forums
Wiki
Developing Applications Manual
Using Subsystems
Reference Manual
no notes exist for this slide
Slide 24
Thank You! Questions?
Framework created by
Sean Corfield (corfield.org)
sean@corfield.org
twitter.com/seancorfield
Presentation by
Javier Julio (www.javier-julio.com)
JJfutbol@gmail.com
twitter.com/javierjulio
no notes exist for this slide
Whenever prom night is just around the corner, just about all young ladies beautiful <a href="http://www.promgowndress.com/">prom dresses</a>. Prom is a really important time in a young girl life <a href="http://www.1stpromdress.com">quinceanera dresses</a>. Each and every girl would like to impress in her <a href="http://www.promdresswholesale.com">prom dress</a> gown and wants all eyes to be on her <a href="http://www.prom-dresses.in">prom dresses</a>. With regard to this you require to move shopping and purchase a <a href="http://www.dressescity.com">prom dresses</a> gown which echoes volumes about your feeling of <a href="http://www.prettypromgowns.com">prom dresses</a> style.
http://www.promgownsdresses.com
http://www.1stpromdress.com
http://www.promdressmarket.com
http://www.promdressbuy.com
http://www.promdresswholesale.com
http://www.dressesok.com
http://www.prom-dresses.in
Posted By: prom dress On: 05/25/11 8:37 PM