1 / 16

Fusebox & CFCs

Fusebox & CFCs. Barney Boisvert 2004 Fusebox Conference. Problems with FB. The “DO in XML” problem Grammar is not full-featured Need query/list/index loops Need nested conditionals Etc. XML is cumbersome No nested layouts?!?!. Two Key Concepts. Encapsulation - being self contained

camden
Download Presentation

Fusebox & CFCs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Fusebox & CFCs Barney Boisvert 2004 Fusebox Conference

  2. Problems with FB • The “DO in XML” problem • Grammar is not full-featured • Need query/list/index loops • Need nested conditionals • Etc. • XML is cumbersome • No nested layouts?!?!

  3. Two Key Concepts • Encapsulation - being self contained • FB doesn’t really do this • CFCs provide help • Abstraction - separate interface from implementation • FuseDocs do this for fuses (mostly) • CFCs excel at it Both of these contribute greatly to the long-term maintainability of code.

  4. Parts of an App Check out this column * You can use CFM templates for this, but it’s messy † You can use FB behind a CFC façade, but that’s even messier

  5. So what is FB? A framework, of course, but what kind? • Application (typical use) • UI (implied by application) • HTTP/text-based (definitely) • Flash (not a chance) • Web Services (ugly, but possible, with CFC help) What about Mach-II? Struts? Ben Hediard’s MVCF (www.benorama.com)?

  6. FB Request Flow

  7. Desired Request Flow

  8. What’s different? • Clear distinction between action and display requests • Clear distinction between UI logic and business logic • Ability to “scalp” the app at any layer, and leave a functional remainder

  9. Why is it different? • FB controller circuit has ALL public fuseactions, both action and display • FB can potentially combine action and display fuseactions • FB’s business logic depends on the controller and it’s framework “Does this have anything to do with user interaction?”

  10. The Layer Stack

  11. Other benefits of CFCs • Can be stateless or stateful • Can easily integrate with Flash & web services • Can be [nearly] transparently replaced with Java or COM • Can be fully encapsulated • More effective testing • No weird assemble-time interferences • Objects can provide easier/better modeling • Help remove that pesky ozone layer

  12. Why Use FB At All? • Procedural nature of HTML clients • FB is awesome at managing text layouts • FB’s already coded, tested and functional

  13. Weighing Frameworks Balancing current needs, anticipated needs, and overhead • I still write pure FB apps (even single-circuit ones) • I never do framework-less apps

  14. Building CFC-based Models • Objects (user, product, etc.) • Processes (add user, check out, etc.) • Collections (user list, cart contents, etc.) • Business Objects & DTOs • Services • Gateways

More Related