SlideShare a Scribd company logo
Built to Last




Building scalable front-end application architectures
with business logic.
Dan Lynch
Engineer & Artist




            questions/thoughts?
                                  @skatalynch
The Web
Building Things




                  1999, AutoCAD 10
I like helping other people
build
SideFX
city builder interface




2006
Building things that build
things

Vim3D

vim interface to building 3D
famo.us




our biz dev built this
app on the first famo.us
framework
interface for building
interactive textbooks




           mathapedia
building tools for people
Modularity is the degree to which   top down
     a system’s components may
     be separated and recombined.
     (wikipedia)

                                            ?
     Abstraction is the process of
     formulating generalized ideas or
     concepts by extracting common
     qualities from specific examples    bottom up
     (the free dictionaty)

10
Modularity                     top down
     •	 odules
      m
     •	 xtensions
      e


                    large-scale rapid development

     Abstraction
     •	 outing
      r
     •	 ages
      p                             bottom up
     •	 ata/APIs
      d
11
Why Modularity?
Adding New Code
Most time you spend is maintaining
code, not writing new code
Intuitive
Co-workers depend on your code to
make sense
Extendability
If features change, it’s
easy to extend or swap
parts
Debug/Test
It’s easy to test individual modules
The Mythical Man Month
Frederick Brooks Jr.




“Men and months are interchangeable commodi-
ties only when a task can be partitioned among many
workers with no communication among them”
Complex Communication
Spaghetti Code
•	 specific to application
•	 not reusable
•	 the app is the testing framework
Perfectly Partitionable
Modules
•	interdependent
•	little knowledge about the application
•	it is the sum of the modules that makes up the application
Module: Each of a set of standardized parts
or independent units that can be used to con-
struct a more complex structure (google definition)
Various Module Definitions +
Terminolgies
•	 JS module pattern
•	 AMD modules
•	 Web application modules
JavaScript Module Pattern




private and public encapsulation using closures
AMD Modules
Web Application Modules


   HTML + CSS + JS


       (components)
Application Modules

       model


        view


      controller
Application Framework

“An Application Framework is like a playground
                 for your code”

              - Nicholas Zakas
Application Framework
module      module     module



module      sandbox    module


extension             extension
             core
extension             extension
Where to start

backbone boilerplate
	 modular + build for production

aura
	 modular + widgets + message passing
Sandbox
facade
“The programmer is most effective if shielded
from, rather than exposed to the details of
construction of system parts other than his
own“

-Frederick Brooks Jr.
each module has a sandbox
    module           module           module



    module           sandbox          module


    extension                        extension
                       core
    extension                        extension

   This promotes loose coupling so you can change
           modules without affecting others
each module has a sandbox
sandbox exposes functionality
     module   module    module




              sandbox




               core
sandbox exposes functionality
application core
module      module    module



module      sandbox   module


extension             extension
             core
extension             extension
module registration, lifecycle,
and intercommunication
application core is responsible for:

message passing



module life-cycle
application core - the mediator




•	communication hub & centralized controller
•	intermediary between interdependent modules
application core - the mediator
                       only N channels!


              module



              module                      mediator




              module



modules use transitive communication through mediator
publish




photo gallery module
publish

             “get-fb-photos”




Gallery Module
“get-fb-photos”




mediator
subscribe
“get-fb-photos”




            FB Integration Module
subscribe




fb integration module
photo gallery module
module life-cycle
build for
extension
extending the core
module      module    module



module      sandbox   module


extension             extension
             core
extension             extension
Where is my layout?
Where do my routes go?
Where does my data live?
Decouple Your Web App
Navigation
 URLs/routes/controllers

Data
 data/models/collections

Pages
 layouts/views/templates
Built to Last
layout extension




enable abstraction of navigation paradigms
route:books

router



         route:books

module                  mediator
         render:books




         render:books
layout
controller
layout
module group extension

If a group of modules
represents an
application, what if we
can manage groups to
run multiple applications
or portals within a single
page app?
module group extension
no
                               change group  v




        route
                         yes
route           group?          controller
module group extension
change group

               swap layout

                       afterRender()


               start modules

  $.when.apply($, promises).done
Protecting Resources/Modules
typical backend

                 flow




                             yes
route         middleware           controller
                        no


    middleware can protect resources
can the front-end JS function like the backend?



           route             controller




   (typical Backbone routing with no FSM)
Finite State Machine
•	 events
•	 states
•	 transitions
•	 actions
Built to Last
fail()

                                               v




                       no




           route
                            yes
  route             fsm           controller


Backbone routing with FSM
v




                                      swap layout
        fail()



            no                 no

                                      start modules
                 yes
route   FSM                 group?



                                yes
                                         enter()




                       controller     resetRoutes()
Built to Last
Built to Last
router extension
•	manage routes, delegate route callbacks to FSM
module groups extension
•	modify core to handle groups with async/dfd
layout extension
•	render views using message passing
fsm extension
•	manage state (group)
•	if routes pass, send allow controllers to callback
data extension
•	manage model/collection cache
what we covered
 how to take core components of a
web application (routes, navigation,
layouts, etc) and divy them up into
  modules/extensions so that the
  application can grow efficiently;
   without the need to refactor.

      bottom up + top down!
node.js	                 tech to use and checkout
	 end-to-end JS!
backbone boilerplate	
	 great for build + gettings started
aura	
	 widgets and module lifecycle
backbone layout manager	
	 views/layouts
async.js
	 asyncronous flow control
grunt.js	
	 build
require.js
	 module loading
r.js
   optimizer
props, credit, and people to checkout

           Tim Branyen
           Addy Osmoni
          Nicholas Zakas
Built to Last
Built to Last
Thank You!




             @skatalynch

More Related Content

PDF
Modular applications with montage components
PDF
Jsf Framework
PDF
Unit 07: Design Patterns and Frameworks (3/3)
PDF
Java server faces
PPTX
KEY
MVC on the server and on the client
PPTX
Angular js
PDF
Sun JSF Presentation
Modular applications with montage components
Jsf Framework
Unit 07: Design Patterns and Frameworks (3/3)
Java server faces
MVC on the server and on the client
Angular js
Sun JSF Presentation

What's hot (18)

PPTX
Introduction to jsf 2
PPTX
Jsf presentation
PDF
Crx 2.2 Deep-Dive
PPT
MVC Demystified: Essence of Ruby on Rails
PDF
Java Web Programming [7/9] : Struts2 Basics
PDF
108 advancedjava
KEY
Javascript Frameworks for Well Architected, Immersive Web Apps
PPTX
Building and managing java projects with maven part-III
PPT
Struts Introduction Course
PDF
2012 04-06-v2-tdp-1163-java e-evsspringshootout-final
PDF
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
PPTX
Asynchronous Module Definition (AMD) used for Dependency Injection (DI) and MVVM
PDF
Content-Driven Web Applications with Magnolia CMS and Ruby on Rails
PDF
Unit 06: The Web Application Extension for UML
PDF
Three WEM Dev Tricks
PPT
JSF basics
PDF
GIDS 2012: Java Message Service 2.0
PPT
Managing JavaScript Dependencies With RequireJS
Introduction to jsf 2
Jsf presentation
Crx 2.2 Deep-Dive
MVC Demystified: Essence of Ruby on Rails
Java Web Programming [7/9] : Struts2 Basics
108 advancedjava
Javascript Frameworks for Well Architected, Immersive Web Apps
Building and managing java projects with maven part-III
Struts Introduction Course
2012 04-06-v2-tdp-1163-java e-evsspringshootout-final
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
Asynchronous Module Definition (AMD) used for Dependency Injection (DI) and MVVM
Content-Driven Web Applications with Magnolia CMS and Ruby on Rails
Unit 06: The Web Application Extension for UML
Three WEM Dev Tricks
JSF basics
GIDS 2012: Java Message Service 2.0
Managing JavaScript Dependencies With RequireJS
Ad

Viewers also liked (14)

PPTX
Talk at FullStack 2016: Automating documentation on JavaScript projects
PDF
WebPagetest Power Users - Velocity 2014
PDF
Isomorphic JavaScript: #DevBeat Master Class
PDF
Enterprise JavaScript Error Handling (Ajax Experience 2008)
PPTX
Scalable JavaScript Application Architecture 2012
PPTX
Teaming Workshops
PDF
From a monolithic Ruby on Rails app to the JVM
PDF
Leadership Tools for Better Teams - Personal History Exercise - 20150615
PDF
Putting Flexbox into Practice
PDF
Pieces Of Me: My Visual Resume
PDF
Codeware
PDF
Navigation Patterns for iOS, Android and More
PDF
Abi Jones : Visual Resume
PDF
Reorganizing Website Architecture for HTTP/2 and Beyond
Talk at FullStack 2016: Automating documentation on JavaScript projects
WebPagetest Power Users - Velocity 2014
Isomorphic JavaScript: #DevBeat Master Class
Enterprise JavaScript Error Handling (Ajax Experience 2008)
Scalable JavaScript Application Architecture 2012
Teaming Workshops
From a monolithic Ruby on Rails app to the JVM
Leadership Tools for Better Teams - Personal History Exercise - 20150615
Putting Flexbox into Practice
Pieces Of Me: My Visual Resume
Codeware
Navigation Patterns for iOS, Android and More
Abi Jones : Visual Resume
Reorganizing Website Architecture for HTTP/2 and Beyond
Ad

Similar to Built to Last (20)

PDF
Scalable JavaScript Application Architecture
PDF
An overview of Scalable Web Application Front-end
PDF
ascitconsultancy-scalable-javascript-application-architecture for ascitconsul...
KEY
Single Page Applications - Desert Code Camp 2012
PDF
Javascript Web Applications Otx Alex Maccaw
PDF
jQquerysummit - Large-scale JavaScript Application Architecture
PDF
Architecting non-trivial browser applications (Jazoon 2012)
PPTX
Web Techdfasvfsvgsfgnolofgdfggy Unit I.pptx
PPTX
Building single page applications
PDF
Building a JavaScript Module Framework at Gilt
PDF
Building businesspost.ie using Node.js
PDF
Best practices for creating modular Web applications
PDF
Front end-modernization
PDF
Front end-modernization
PDF
Front-End Modernization for Mortals
PDF
MVC pattern for widgets
PDF
Large-Scale JavaScript Development
PDF
AngularJS in Production (CTO Forum)
PPTX
Single Page Application Development with backbone.js and Simple.Web
PDF
Developing Backbonejs Applications Early Release Addy Osmani
Scalable JavaScript Application Architecture
An overview of Scalable Web Application Front-end
ascitconsultancy-scalable-javascript-application-architecture for ascitconsul...
Single Page Applications - Desert Code Camp 2012
Javascript Web Applications Otx Alex Maccaw
jQquerysummit - Large-scale JavaScript Application Architecture
Architecting non-trivial browser applications (Jazoon 2012)
Web Techdfasvfsvgsfgnolofgdfggy Unit I.pptx
Building single page applications
Building a JavaScript Module Framework at Gilt
Building businesspost.ie using Node.js
Best practices for creating modular Web applications
Front end-modernization
Front end-modernization
Front-End Modernization for Mortals
MVC pattern for widgets
Large-Scale JavaScript Development
AngularJS in Production (CTO Forum)
Single Page Application Development with backbone.js and Simple.Web
Developing Backbonejs Applications Early Release Addy Osmani

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
Teaching material agriculture food technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Machine learning based COVID-19 study performance prediction
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Electronic commerce courselecture one. Pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Cloud computing and distributed systems.
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Big Data Technologies - Introduction.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Teaching material agriculture food technology
Network Security Unit 5.pdf for BCA BBA.
Machine learning based COVID-19 study performance prediction
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Mobile App Security Testing_ A Comprehensive Guide.pdf
Encapsulation_ Review paper, used for researhc scholars
Advanced methodologies resolving dimensionality complications for autism neur...
Digital-Transformation-Roadmap-for-Companies.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Unlocking AI with Model Context Protocol (MCP)
Electronic commerce courselecture one. Pdf
Programs and apps: productivity, graphics, security and other tools
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Dropbox Q2 2025 Financial Results & Investor Presentation
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Cloud computing and distributed systems.
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

Built to Last