Upgrade to Pro — share decks privately, control downloads, hide ads and more …

From Spaghetti to Modern Frameworks - A Journey...

From Spaghetti to Modern Frameworks - A Journey Through ColdFusion Application Architecture

This is a session I gave at Adobe CF Summit India in 2024.

I've been working with CFML for the better part of 25 years now. Over this time, we've come a long way in how applications in ColdFusion are being written. This is a somewhat lighthearted, yet technically insightful trip down memory lane as we explore the evolution of ColdFusion application architectures and frameworks.

This talk will cover the progression from early and really basic structural patterns to modern, sophisticated frameworks, highlighting how ColdFusion development practices have matured over the years.

Key Points:
1. Early days: Spaghetti code and the need for structure
2. Home-grown frameworks: Includes, Custom Tags, CFCs and basic Model-View-Controller
3. The rise of Fusebox: Introducing circuit and fuseaction concepts
4. Mach-II: Moving towards object-oriented design
5. FW/1: Lightweight alternative for rapid development
6. ColdBox: Full-stack HMVC framework revolution
7. Modern ColdFusion: Current best practices and architectural patterns

Throughout the presentation, we'll showcase code examples demonstrating the different styles and approaches of each era, sprinkled with some humorous anecdotes about the challenges developers faced.

We'll also discuss how these changes reflect broader trends in web development and how ColdFusion has changed to meet evolving industry needs.

This talk will provide valuable historical context for both seasoned ColdFusion developers and newcomers to the platform, offering insights into why certain patterns emerged and how they've shaped current best practices in ColdFusion application development.

Kai Koenig

December 07, 2024
Tweet

More Decks by Kai Koenig

Other Decks in Programming

Transcript

  1. HELLO HELLO, MY NAME IS KAI ▸ Software Architect in

    the back end and mobile app space ▸ Maths and Computer Science by education, 25+ yrs of industry experience ▸ Co-Organiser of CFCAMP in Germany ▸ Work interests: ▸ CFML, JVM tech, Python, Ruby and managing *nix infrastructure platforms ▸ Android, Kotlin, Flutter and building SDKs ▸ Data Science and AI ethics
  2. Importance of intentional architecture design Intentional architecture design is critical

    for the success of any software project. It establishes a clear framework that guides development efforts, ensuring that all components align with business objectives and user needs. By prioritising intentional design, organisations can enhance maintainability, scalability, and performance, while reducing technical debt and fostering a culture of collaboration among teams.
  3. Importance of intentional architecture design Intentional architecture design is critical

    for the success of any software project. It establishes a clear framework that guides development efforts, ensuring that all components align with business objectives and user needs. By prioritising intentional design, organisations can enhance maintainability, scalability, and performance, while reducing technical debt and fostering a culture of collaboration among teams.
  4. Importance of intentional architecture design Intentional architecture design is critical

    for the success of any software project. It establishes a clear framework that guides development efforts, ensuring that all components align with business objectives and user needs. By prioritising intentional design, organisations can enhance maintainability, scalability, and performance, while reducing technical debt and fostering a culture of collaboration among teams.
  5. We need to understand where we come from ▸ The

    web as we know it started in the early 1990s ▸ ColdFusion stems from the second wave of web back end technologies, together with: ▸ ASP classic ▸ JSP ▸ PHP WHY THIS TALK?
  6. ColdFusion and CFML had a wild journey ▸ DBML ->

    CFML in the mid-1990s ▸ Numerous Adobe CF server releases ▸ Platform transition to Java / JVM ▸ Consistently being called a dead language ▸ Modularisation and adaptability for cloud WHY THIS TALK?
  7. THE BEGINNING The dawn of dynamic websites ▸ CGI and

    Perl dominated the industry ▸ Static HTML with minimal interactivity: ▸ Static forms submitted to CGI scripts ▸ Databases just started to be used in web apps ▸ ColdFusion was actually a game changer
  8. THE BEGINNING In the beginning… there was chaos ▸ Early

    CF’s mission was connecting to databases ▸ Common “pattern”: ▸ Take existing static HTML page with tables, rename to .cfm ▸ Slap some <cfquery> code on the top of the page ▸ <cfoutput> around table Dynamic Pages/Content
  9. THE BEGINNING Late 90s web revolution ▸ Rise of e-commerce

    ▸ First .com boom: ▸ Huge amounts of new sites used ColdFusion ▸ Browser wars driving first elements of client-side innovation
  10. CFML IMPROVEMENTS First steps towards organisation ▸ <cfinclude> for simplistic

    code reuse ▸ Application.cfm ▸ Custom tags emerge Basic Modularisation
  11. CFML IMPROVEMENTS Object-orientation takes hold ▸ Microsoft launches .NET framework

    ▸ Java dominates the enterprise: ▸ Struts framework (early MVC in Java) ▸ Rise of design patterns like the GoF patterns ▸ J2EE
  12. CFML IMPROVEMENTS Components change everything ▸ Introduction of (somewhat) object-oriented

    concepts to CFML ▸ Benefits: ▸ “Objects” and “methods” ▸ Encapsulation ▸ Public/Private/Remote method accessibility Encapsulation
  13. CFML IMPROVEMENTS Web standards ▸ XHTML / CSS ▸ XML

    becomes the dominating data format ▸ Trend towards separation of concerns
  14. CFML IMPROVEMENTS DIY “Model”-”View”-”Controller” ▸ Separating business logic from view

    and often wildly constructed controllers ▸ Common concepts: ▸ Model: CFC and Custom Tags ▸ View: .cfm pages and Custom Tags ▸ Controller: basic routing concepts, often using including other elements Separation of Concerns
  15. Fusebox: circuit-based architecture ▸ Core concepts: ▸ Circuits and Fuseactions

    ▸ XML configuration ▸ Standard-directory structure made it easy to migrate to Fusebox. ▸ Initially: Pre-CFC, later Fuse Box with CFCs was added THE FRAMEWORK ERA
  16. Mach-II: a revolution? ▸ Mach-II was the first iteration of

    an intentional OO-framework for CFML: ▸ Event-driven architecture ▸ Listener/Handler pattern ▸ XML configuration THE FRAMEWORK ERA Event-driven
  17. Rich Internet Applications ▸ jQuery brings JavaScript back: ▸ Solves

    browser incompatibility issues ▸ Offers easy API ▸ RIAs by Macromedia (and later Adobe): ▸ Ajax support in CFML ▸ Flash(forms) and Flex support in CFML ▸ JSON takes over from XML as the leading data/config format THE FRAMEWORK ERA
  18. Convention over configuration with FW/1 ▸ Spiritual successor of Fusebox

    5: ▸ Simplified structure ▸ Inspired by ideas from Ruby on Rails ▸ Conventions: ▸ Naming conventions instead of complex configuration and setup ▸ Zero-XML configuration THE FRAMEWORK ERA
  19. FW/1 ecosystem ▸ Since version 3.1, FW/1 contains: ▸ DI/1

    - a dependency injection framework ▸ AOP/1 for Aspect-oriented programming ▸ FW/1 also exists for Clojure THE FRAMEWORK ERA Convention over Configuration Dependency Injection
  20. And there are (were) more… ▸ Recent and ongoing: ▸

    ColdFusion built-in REST ▸ Taffy (lightweight REST APIs) ▸ CF On Wheels ▸ Historic: Model-Glue (incl. ColdSpring) THE FRAMEWORK ERA
  21. The impact of the Node world ▸ Node and NPM

    changed the scene for package and library management ▸ CommandBox and Forgebox solve this problem for the CFML landscape ▸ JS frameworks dominate the client world: ▸ React ▸ Angular ▸ VUE MODERN CFML ARCHITECTURE Large-scale modularisation
  22. ColdBox enters the room ▸ Not a framework, more of

    a platform: ▸ ColdBox HMVC ▸ TestBox, ContentBox, WireBox etc ▸ Core features: ▸ Dependency injection and routing ▸ Module-based design leading to extensibility ▸ REST APIs and support for SPAs MODERN CFML ARCHITECTURE Small-scale modularisation Testability
  23. Today’s architecture requirements ▸ Cloud-ready: ▸ Small services or microservices

    and API-first design ▸ Container deployments ▸ Serverless deployments ▸ Trend towards leaving the hyperscalers and the idea of a “modern monolith” LOOKING FORWARD
  24. Key takeaways ▸ Intentional architecture choices are (usually) the key

    to success. ▸ Evolution and architecture styles often mirrors industry trends. ▸ Modern CFML can compete with any web platform. ▸ You can build good systems with any tech, you can build terrible systems with any tech. ▸ Be adaptable to cloud and on-premise by building small, composable services. LOOKING FORWARD
  25. Importance of intentional architecture design Intentional architecture design is critical

    for the success of any software project. It establishes a clear framework that guides development efforts, ensuring that all components align with business objectives and user needs. By prioritising intentional design, organisations can enhance maintainability, scalability, and performance, while reducing technical debt and fostering a culture of collaboration among teams.
  26. OTHER THINGS Get in touch Kai Koenig Email: [email protected] CFML

    Slack: @agentk Boxteam Slack: @Kai Koenig LinkedIn: https://www.linkedin.com/in/kaikoenig/ Slides: https://speakerdeck.com/therealagentk