Top Banner
FW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland
32

FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Jun 08, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

FW/1The Invisible Framework

Sean CorfieldRailo Technologies, Inc.

Scotch on the Rocks, March 3-4, 2011Edinburgh, Scotland

Page 2: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

What's in it for you?

• Don't like frameworks?

• Frameworks are too complicated?

• Don't like XML / configuration?

• FW/1 lets you build your application and forget about the framework - it's invisible!

Page 3: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Don't Like That?

• Fine, go see:

• OAuth... WTF?

• Matt Gifford

• Trust, Communication, Honesty: Pick Two

• Chris Pelsior

Page 4: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Who am I?

• Lead Developer, World Singles LLC

• CEO, Railo Technologies, Inc.

• Fast Free Open Source CFML Engine

• Development / Support Consultancy

• Nine years of CFML

• Always been Java, always been OO!

• Long history of IT before that (grey hair!)

Page 5: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

What is FW/1?

Page 6: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

What is FW/1?

• Framework One

• Very lightweight - just one CFC

• Convention-based - no configuration

• Model-View-Controller

Page 7: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Why did I create it?

• Why another MVC framework?

• Dissatisfied with other frameworks

• They're big, bloated, complex and, with one or two exceptions, they require XML configuration in some way or other

Page 8: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Why "FW/1"?

• It's a framework in one file!

• Years ago, I used a programming language called PL/1: Programming Language One

• "IBM wanted a single programming language for all users"

• One language to rule them all!

Page 9: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Quickly: what is MVC?

• Model - data & business logic

• View - the display pages

• Controller - the "traffic cop" that routes requests, updates your Model and provides data to your Views

Page 10: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Conventions

• FW/1 assumes your application is made up of sections and pages:

• index.cfm?action=product.catalog

• index.cfm?action=cart.display

• Supports SES URLs:

• index.cfm/product/catalog

• index.cfm/cart/display

Page 11: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Conventions

• /product/catalog ➭

• product controller (cfc), catalog() method☟

• product folder, catalog view (.cfm)

• /cart/display ➭

• cart controller (cfc), display() method☟

• cart folder, display view (.cfm)

• ☞ controller methods are optional

Page 12: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Conventions

• Additional conventions determine

• how layouts are found and applied

• how services can be called automatically

Page 13: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

The Simplest App

// Application.cfc:

component extends="framework" { }

<!--- index.cfm (empty) --->

<!--- views/main/default.cfm: --->

<p>Hello World!</p>

Page 14: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

The Simplest App

• http://fw1.local/examples/hello1/

Page 15: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Views & Layouts

• A view is a display page (or page fragment)

• A layout is a wrapper (around #body#)

• Layouts may render additional views

• header, footer, navigation

Page 16: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Views & Layouts

• http://fw1.local/examples/hello2/

Page 17: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Views & Layouts

• views/ folder contains

• subfolder for each section of your app

• containing the pages for that section

• layouts/ folder contains

• site-wide layout (default.cfm)

• per-section layouts if needed

• per-page layouts if needed

Page 18: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Views & Layouts

• Layouts are optional

• Technically speaking, views are optional

• onMissingView() called if no view found

• Default behavior: viewNotFound()

• Throw an exception

• Default view can be overridden

• Controller can call setView()

Page 19: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Controllers

• The "pounding heart" of an MVC app

• Contain the high-level "traffic cop" logic

• Validation and control flow

Page 20: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Controllers

• controllers/ folder contains

• CFC for each section of your app

• containing methods for pages in that section (optional)

Page 21: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Litepost with FW/1

• http://fw1.local/litepost/fw1/

Page 22: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Business Logic

• Convention allows for

• services/ folder containing

• CFC for each section of your app

• containing methods for pages in that section (optional)

• Or call services directly from controllers

• Recommended approach!

Page 23: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Bean Factory Support

• If you use a bean factory (of any sort)

• FW/1 asks it for controllers & services

• FW/1 uses it for autowiring beans into controllers & services that it manages

Page 24: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Subsystems

• Modular construction of large applications

• Reuse FW/1 applications as-is

• Similar to modules in Mach-II (but simpler)

Page 25: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Subsystems

• http://fw1.local/examples/

Page 26: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

FW/1 in Production?

• Yes, Release 1.0 was early January 2010 after about six months of prerelease testing

• Lots of users have live sites in production!

• Mura uses FW/1 for its admin (as of 5.2)

• Mura 5.2 was released February 2010

• Release 1.1 June 2010, 1.2 October 2010

• Release 2.0 in development

Page 27: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

FW/1 Roadmap

• 2.0 - all cfscript

• Requires CF9 / Railo 3.2 / OpenBD 1.4

• 1.3 - bug fix / migration release

• 1.x stream will continue to support older CFML engine releases

Page 28: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

FW/1 Wrap-Up

Page 29: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

The Invisible Framework

• Very lightweight (& fast)

• Easy to learn, easy to use

• No XML, no configuration

• FW/1 is all about simplicity

• Just like CFML!

Page 30: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Resources

• Main FW/1 project site

• http://fw1.riaforge.org/

• Over 5,700 downloads!

• Mailing list

• http://groups.google.com/group/framework-one/

• Over 360 members!

Page 31: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Q&A

Page 32: FW/1 The Invisible Framework - An Architect's ViewFW/1 The Invisible Framework Sean Corfield Railo Technologies, Inc. Scotch on the Rocks, March 3-4, 2011 Edinburgh, Scotland Mark

Mark Drew - Railo

Contacting Me

• seancorfield on AIM / Skype / Twitter / Y!M

[email protected] on Gtalk

[email protected] - http://getrailo.com

[email protected] - http://corfield.org