FW/1 - Framework One - Twin Cities ColdFusion User Group

Download Report

Transcript FW/1 - Framework One - Twin Cities ColdFusion User Group

FW/1 - Framework One
An introduction to the ColdFusion framework
created by Sean Corfield.
Presented by Ben Ellefson
About Me
 ColdFusion developer for 9 years
 Twin Cities CFUG Manager
 Framework enthusiast
 Experience with Fusebox, Model-Glue,
Mach-ii, ColdBox, ColdSpring, Reactor
and now FW/1
 Disclaimer: Mach-ii fan
What is FW/1?
 ColdFusion MVC Framework
 Lightweight – single CFC file (1700 lines)
 Convention based instead of configuration
based
 Flexible code organization
Why Sean made FW/1
 Dissatisfied with current application
frameworks





Too bloated
Too complex
Requires XML
Dependent on configuration
Too much overhead for simple apps
Simple Application
 org
 Contains single framework file
 views
 Contains section folders
 View cfm files within each folder
 Application.cfc
 Extends org.corfield.framework
 Index.cfm
 Blank
Standard Application
 controllers
 Contains cfc for each section
 layouts
 Contains cfm for each layout
 services
 Contains cfc for each service
FW/1 URLs
 All links direct to /index.cfm
 Pages access using ?action=section.item
 Section = name of folder within views folder
 Item = file within views/section folder
 SES URLs available
 /index.cfm/section/item/name/value
Controllers
 ?action=section.item looks for the method
item() in /controllers/section.cfc
 Passes the request collection “rc” as a
single argument. Struct containing url and
form variables, plus more.
 Automatically calls before(), startItem(),
Item(), endItem(), after()
 Controllers are cached, cleared with
?reload=true
Layouts
 Multiple layouts are available
 View Layout: /layouts/section/item.cfm
 Section Layout: /layouts/section.cfm
 Site Layout: /layouts/default.cfm
 Layouts cascade from view to section to
site
 Cancel cascading by setting
request.layout = false
 #body# contains current rendered view
Services
 Services called from controller by
fw.service(“cfc.function",“variable")
 Results placed in requet collection “rc”
with variable name stated in the call
Views
 Receive the request collection “rc” from
the controller to display variables
populated by the service.
 View file called is automatically
determined by the action (i.e. section.item)
 View file can be changed by calling
setView() or setLayout() to call a new
action.
Critique
 Hard to find information




No framework website
Documentation only found through Corfield’s Blog
No community around FW/1
Very little found via Google search
 Framework not compatible with CF previous to
9.0.1
 Conventions assume small app and do not allow
for deep nesting of folders.
Critique
 Sample and Skeleton apps are poor
 Filled with bugs
 Too simple to understand how a full app
would be built with FW/1
 No comments in code
 In 6 hours testing for this presentation, I
was unable to build one page that had a
query in the service passed to the view to
display.
More Information
 Available for download at
http://fw1.riaforge.org/
 Free for use under the Apache 2.0 License
 Latest version requires ColdFusion 9.0.1
 Documentation at
https://github.com/seancorfield/fw1/wiki