Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

30
Modern Software Architecture BUILDING SOLUTIONS FOR WEB, CLOUD, AND MOBILE

Transcript of Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Page 1: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Modern Software ArchitectureBUILDING SOLUTIONS FOR WEB, CLOUD, AND MOBILE

Page 2: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Who is this guy?

Daniel Mohl

[email protected]

www.twitter.com/dmohl

blog.danielmohl.com

Page 3: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Who is this guy?

Page 4: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

AgendaWhy should we change?Trends in the IndustryArchitecting for the WebArchitecting for the CloudArchitecting for MobileWrapping it Up

Page 5: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Why should we change?

Page 6: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Trends in the Industry

Moving to the clientBack to the metalHorizontal ScalingSchema-less Data StoresUser Centric Solutions

Page 7: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Architecting for the WebNo more WebForms – Reduce leaky abstractionsSeparation of ConcernsDesign Patterns – Some new, some oldSingle Page Applications

Page 8: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Single Page Applications

Page 9: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Single Page Applications - Layers

Views (templates - template engines such as Knockout, Handlebars, and Mustache)

JavaScript Models

Collections, Controllers, or ViewModelsRouter (Sammy.js, Backbone.js, custom)

Controllers

Repositories Models

Page 10: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Single Page Applications – MV*/C

View

Model

Controller

Page 11: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Single Page Applications – MVVM

View

ViewModel

Model

Page 12: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Single Page Applications – MVVM

Page 13: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

A Few JavaScript Patterns

Page 14: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Nested Namespace Pattern Addy Osmani's Book - Learning JavaScript Design Patterns

var myApp = myApp || {}; myApp.routers = myApp.routers || {}; myApp.model = myApp.model || {}; myApp.model.special = myApp.model.special || {};

Page 15: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Self-executing Anonymous Functions

(function( $ ) { var myVar, myFunc; myVar = 1; myFunc = function( val ) { return val + myVar; }; console.log( myFunc(2) ); })( jQuery );

Page 16: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Revealing Module Pattern (function( pub, $ ) {

var myPrivateFunc = function(val) {

return val * 100;

};

pub.myFunc = function( val1 ) {

return val1 + myPrivateFunc (val1);

};

})( window.myApp.myMod = window.myApp.myMod || {}, jQuery );

window.myApp.myMod.myFunc( 2 );

Page 17: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Other Patterns We Know and Love Messaging Patterns like Pub/Sub using AmplifyJS and PostalJS Observer pattern – $.trigger and $.on Façade - Seen a lot in jQuery – like $.get(…) Strategy and Command (inherit due to functional nature of JS) Iterator pattern - $.each Map/Reduce - _.map and _.reduce Memoize - _.memoize

Page 18: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Architecting for the Cloud

Page 19: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Competing Consumer

Image from this Windows Azure Tutorial

Page 21: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

From http://sverrehundeide.blogspot.com/2010/02/persistence-with-command-and-query.html

Page 22: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

MapReduce Pattern

http://Image from this Wikipedia page

Page 23: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Architecting for Mobile

Page 24: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Faster and smarter

Page 26: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

NoSQL

Diagram from bllllog.zenika.com

Page 27: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Web vs. Native Web:

- jQuery Mobile, Sencha Touch, etc.

- HTML5 and CSS3 (offline storage, input tags, improved animations, Media Queries)

- Write once, deploy many

- Responsive Design helpers like Twitter Bootstrap and Foundation 3

Page 28: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Web vs. Native Native:

- Faster and richer experience

- Better offline support (but still have to manage data access)

- Device hardware access (camera, GPS, accelerometer, flash, etc.)

- Seems to be preferred by consumers (look at Facebook for an example)

- Easier access

PhoneGap and others help provide a bridge

Page 29: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

Wrapping it UpUser FocusedMovement to JavaScript and the client (Single Page Apps)Reduce leaky abstractionsUse Modern HTTP ServicesBuild both Responsive Web sites and native mobile appsAdd NoSQL to the mixReduce payload sizeFunctional First (F#, Scala)

Page 30: Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile

My Contact Information

Daniel Mohl

[email protected]

www.twitter.com/dmohl

blog.danielmohl.com