javascript architecture: the front and the back of it

31

Upload: kyle-simpson

Post on 17-May-2015

4.785 views

Category:

Technology


1 download

DESCRIPTION

Explore new ways to use JavaScript on the server and in the browser to achieve scalable, secure, robust, and maintainable UI architecture for web applications.

TRANSCRIPT

Page 1: JavaScript Architecture: The Front and the Back of It
Page 2: JavaScript Architecture: The Front and the Back of It

JavaScript Architecture:The Front and the Back of

It

SXSWi 2010Kyle Simpson

@getifyhttp://getify.me

#frontandbackofit

#jsarch

Page 3: JavaScript Architecture: The Front and the Back of It

UI Architecture

all the stuff that it takes to process, package, deliver, and communicate with the client (presentation layer)

Page 4: JavaScript Architecture: The Front and the Back of It

UI Architecture

url routing

data validation

data formatting

templating

ajax

Page 5: JavaScript Architecture: The Front and the Back of It

UI Architecture

in between the FRONT end and the BACK end is…

the MIDDLE end

Page 6: JavaScript Architecture: The Front and the Back of It

traditional web architecture

Page 7: JavaScript Architecture: The Front and the Back of It
Page 8: JavaScript Architecture: The Front and the Back of It

what‘s my motivation?

Page 9: JavaScript Architecture: The Front and the Back of It

1. performance

Page 10: JavaScript Architecture: The Front and the Back of It

2. MVC

Page 11: JavaScript Architecture: The Front and the Back of It

spaghetti codemove over, QBasic

Page 12: JavaScript Architecture: The Front and the Back of It

3.DRY

Page 13: JavaScript Architecture: The Front and the Back of It

4. role separatio

n

Page 14: JavaScript Architecture: The Front and the Back of It

a new “view”

Page 15: JavaScript Architecture: The Front and the Back of It

CVCclients views controllers

Page 16: JavaScript Architecture: The Front and the Back of It
Page 17: JavaScript Architecture: The Front and the Back of It

clients

everything is a client of everything else

decoupled, modular, scalable

Page 18: JavaScript Architecture: The Front and the Back of It

views

templating, portable, DRY, platform agnostic,

core web technology

Page 19: JavaScript Architecture: The Front and the Back of It

controllers

small, independent, powerful

Page 20: JavaScript Architecture: The Front and the Back of It

what i‘m NOT

suggesting

another framework

ditch whole architecture

mvc is wrong/weak

Page 21: JavaScript Architecture: The Front and the Back of It

CVC is an alternate pattern for thinking about UI architecture

what i AM suggesting

it‘s ok to rethink!

Page 22: JavaScript Architecture: The Front and the Back of It

JavaScript

(on the server)

Page 23: JavaScript Architecture: The Front and the Back of It

node.js (V8)

narwhal(rhino)

JavaScriptCore, SpiderMonkey, etc

Page 24: JavaScript Architecture: The Front and the Back of It

CommonJS

files

i/o

processes

networking

Page 25: JavaScript Architecture: The Front and the Back of It

BikechainJS

V8 “engine” modules

Page 26: JavaScript Architecture: The Front and the Back of It

CVC + JavaScript

the power of UI architecture in the hands of front-end

engineers

=

Page 27: JavaScript Architecture: The Front and the Back of It

but how????

Page 28: JavaScript Architecture: The Front and the Back of It

HandlebarJS{ }

templating engine text/html templates

JSON data input

Page 29: JavaScript Architecture: The Front and the Back of It

details, details…

100% JavaScript (browser or server)

application “state” selects templates

“compiles” templates into JS

Page 30: JavaScript Architecture: The Front and the Back of It

Wrapping up

Page 31: JavaScript Architecture: The Front and the Back of It

More info

http://blog.getify.com

http://spkr8.com/talks/2518

http://github.com/getify/BikechainJS

http://github.com/getify/HandlebarJS

please provide feedback!!!!

Kyle Simpson@getifyhttp://getify.me

#jsarch

http://sxsw.getify.com

#frontandbackofit