SlideShare a Scribd company logo
1 of 37
Enterprise HTML5 Patterns
AKQA Anorak: June 2013
James Turner
Architect
james.turner@caplin.com
What am I talking about ?
What is “enterprise” ?
We have replaced, functionally large diverse,
desktop thick client trading systems with
with “single page” web applications.
How we did it ?
Architectural patterns and technologies used.
Good news for web-devs
http://addyosmani.com/resources/essentialjsdesignpatterns/book/
Move desktop trading to browsers (1)
Move desktop trading to browsers (2)
Business Drivers
▶  Increase trade volumes
–  Integrate pre-trade information
▶  Reduce cost of sale
▶  Direct channel to customer
–  Enhanced user experience
–  Branding
▶  Zero deployment: URL to customer
–  Reduced onboarding time + cost
–  Reduced maintenance
Reverse barrier convertibles
“10 minutes rather than up to 2 hours on phone with a sales trader”
Technology Drivers
▶  Mobile
–  Cross device support
▶  Improved browser ecosystem
–  Browser performance debugging much better
–  Fewer browser differences
–  Vibrant open source community
▶  HTML5
–  Local storage, web-sockets, CSS3 …
▶  Death of alternatives
–  Flash/Flex, Silverlight
Characterizing “enterprise”
HTML5 applications
More than
“A lot of code”
The application
▶  “A lot of code” 250k + LOC
▶  Single page “thick client” applications
–  Different assumptions
–  Runs all day, memory leaks
–  UX of lazy loading
▶  Consistency: theming/skinning/UX
▶  Internationalisation
▶  Streaming financial tradable prices
–  Screen update performance
–  Trade on “displayed price”
–  Graceful degradation
–  Throttling, scheduling
Multiple teams
▶  10-100’s of developers
▶  Multiple independent teams
–  Independent versioned deployment lifecycle
–  Share some code
–  Rest Isolated
▶  Banks are notoriously silo’d by asset class
Different cultures
▶  UX/Graphic designers
▶  Web Developers (jQuery anyone)
▶  Product Owners, Product Managers,
Business Analysts
▶  Server-side developers
–  Decouple dependencies
▶  QA’s (programming QA’s)
▶  Operations
–  Deploy artifacts
–  Same artifacts for TEST/UAT/PROD
–  Directory services
Coolness
12
Armageddon
“Monday morning: Ooops my weekend
check-in just changed the background
colour of the entire application”
How we did it:
1.  Components
2.  Code organization
3.  App structure + patterns
4.  Testing
Components
Split by feature, not technology
16
CSS
HTML
JS
config
i18n
images
tests
CSS
HTML
JS
config
tests
images
i18n
CSS
HTML
JS
config
tests
images
i18n
CSS
HTML
JS
config
tests
images
i18n
CSS
HTML
JS
config
tests
images
i18n
▶  Independent business feature
▶  No direct dependencies to other components
▶  Minimal public interface
–  Event bus (publish/subscribe)
–  Component API
▶  Code sharing mechanism
–  Libraries
–  Modules
▶  Conforms to conventions/name-spacing
▶  Can be pre-built
What is a component
Contents
Deploy
Deploy
Workbench
Instant reload imperative for developer productivity
Conways’Law
“Organizations which design systems ...
are constrained to produce designs which
are copies of the communication structures
of these organizations"
Code Structure
APPLICATION
MODULE A
COMPONENT 1
COMPONENT 2
MODULE B
COMPONENT 3
COMPONENT 4
ASPECTS
MOBILE
DESKTOP
LIBRARIES
INC THIRD-PARTY
Inheritance + Name-spacing
▶  CSS
–  App defines common “theme”
–  Components inherit theme
–  Override with more specific CSS rules
•  Need name-spacing
–  Use CSS pre-processor (e.g. LESS,SASS)
–  Define an ontology
▶  XML/HTML
–  Name-spacing for unique ID’s
JavaScript Coding
▶  Fine grained OO
–  We average about 100 LOC per class
▶  One class per file
▶  Design patterns
▶  SOLID (Uncle Bob)
▶  Coding standards
–  Inheritance
–  JsHint
▶  Common code in libraries
▶  Interpreted: so testing is more important
▶  JsLint /coverage
Bundling
dev-server
bundling
(enforcement)
APPLICATIO
N
BLADESET A
BLADE 1
BLADE 2
BLADESET B
BLADE 1
BLADE 2
ASPECTS
MOBILE
DESKTOP
ProjectsEclipse
IntelliJ
Sublime
NetBeans
Vi/Emacs
……..
IDE of choice
running app
J2EE
ServerWAR
deploy
ZIP CDN
Directory
services
App Structure
CLIENT SERVER
TraderApp
Layout
Managercomponent
component
component
component
service
service
service
service
event
bus
HTML Bundle
CSS Bundle
I18n Bundle
XML Bundle
JavaScript Bundle
Application
Server
JavaScript Interfaces
▶  Defines the contract a component should
conform to.
–  A set of method signatures
▶  Multiple classes “implement” the same interface
▶  Provides a hook for documentation
▶  Hook for IDE tooling
Service Registry
var service = new caplin.XhrXmlResourceServiceProvider(this.sXmlBundleUrl);
caplin.ServiceRegistry.register("caplin.XmlResourceService”, service);
var xmlResourceService = caplin.ServiceRegistry.getService("caplin.XmlResourceService");
var tradeModelNode = xmlResourceService.getXmlDocument("tradeModels");
Registration:
Usage:
Event Hub
▶  Publish/Subscribe inside the browser
–  Many to many (or none)
▶  Defined by an interface (contract)
▶  Methods cannot return anything
▶  Classic example: logging
▶  Nice Article:
http://blog.caplin.com/2012/12/07/event-hub-pubsub-in-the-browser/
Component Interface
▶  Used by layout managers to manage GUI
components
▶  Defines GUI lifecycle events
–  getElement(),
–  onOpen(),
–  onResize(),
–  onSerialize() etc.
MVVM Pattern
ViewRendering to screen
Domain
Model
business semantic method callslistens
Reused across many
screens
View
Model
gestureslistens
Logical representation
of the view
(an adaptor)
<button class=‘..’
data-bind=‘click:buttonClicked’>
Execute Trade
</button>
HTML template with bindings
$(button).click(function(){
vm.buttonClicked()
});
jQuery Control
Our HTML5 MVVM
Domain
Model
executeTrade()complete()
Message
Service
send()receive()
View
Model
buttonClicked()tradeButtonEnabled
No DOM Access
XmlHttpRequest
binding framework
e.g. KnockoutJs
The Testing Triangle
Functional
GUI testing
ITs
Unit Tests
manual
Acceptance
Tests
Performance
Tests
Integration Tests
- Selenium -
(automated
manual tests)
Unit Tests
manual
Performance
Tests
Test by contract
Browser
GUI
logicaluseractions
servicecalls
Given “form is opened”
When “user executes trade”
Then “trade message sent to server”
Server
Code
RESTfulAPI
Given “server is started”
When “trade message received”
Then “money is sent somewhere”
Test by contract
MVVM and services
View
Model
Domain
Model
complete()
View
execute()
Given …
When …
Then …
Fixtures
executeTrade()
tradeButtonEnabled
Message
Service
Stub
send()
receive()
Test Infrastructure
js-test-driver
Server
Bundlers
JavaScript
Dependencies
jsTestDriver.conf
plugin:
- name: "BundleInjector"
jar: …/js-jstd-plugin.jar
module: com.caplin.jstd.BundlerPlugin
load:
- bundles/i18n/en_i18n.bundle
- bundles/js/js.bundle
test:
- tests/**.js
serve:
- bundles/html.bundle
- bundles/xml.bundle
Plugin
JavaScript
Test Files
HTML/XML
Dependencies
In summary:
divide + conquer
Natural fine grained OO coding
Components
Common code in libraries
Split GUI Code into
Dom interactions
View Model
Domain Model
Services for stubbing
GWT + Test by contract
We will soon be open-sourcing
our implementation of this
architecture
www.bladerunnerjs.org

More Related Content

What's hot

Using ELK-Stack (Elasticsearch, Logstash and Kibana) with BizTalk Server
Using ELK-Stack (Elasticsearch, Logstash and Kibana) with BizTalk ServerUsing ELK-Stack (Elasticsearch, Logstash and Kibana) with BizTalk Server
Using ELK-Stack (Elasticsearch, Logstash and Kibana) with BizTalk ServerBizTalk360
 
Delivering big content at NBC News with RavenDB
Delivering big content at NBC News with RavenDBDelivering big content at NBC News with RavenDB
Delivering big content at NBC News with RavenDBJohn Bennett
 
Change data capture with MongoDB and Kafka.
Change data capture with MongoDB and Kafka.Change data capture with MongoDB and Kafka.
Change data capture with MongoDB and Kafka.Dan Harvey
 
How Kafka and MemSQL Became the Dynamic Duo (Sarung Tripathi, MemSQL) Kafka S...
How Kafka and MemSQL Became the Dynamic Duo (Sarung Tripathi, MemSQL) Kafka S...How Kafka and MemSQL Became the Dynamic Duo (Sarung Tripathi, MemSQL) Kafka S...
How Kafka and MemSQL Became the Dynamic Duo (Sarung Tripathi, MemSQL) Kafka S...HostedbyConfluent
 
Real-time Data Streaming from Oracle to Apache Kafka
Real-time Data Streaming from Oracle to Apache Kafka Real-time Data Streaming from Oracle to Apache Kafka
Real-time Data Streaming from Oracle to Apache Kafka confluent
 
Low-latency data applications with Kafka and Agg indexes | Tino Tereshko, Fir...
Low-latency data applications with Kafka and Agg indexes | Tino Tereshko, Fir...Low-latency data applications with Kafka and Agg indexes | Tino Tereshko, Fir...
Low-latency data applications with Kafka and Agg indexes | Tino Tereshko, Fir...HostedbyConfluent
 
Event sourcing Live 2021: Streaming App Changes to Event Store
Event sourcing Live 2021: Streaming App Changes to Event StoreEvent sourcing Live 2021: Streaming App Changes to Event Store
Event sourcing Live 2021: Streaming App Changes to Event StoreShivji Kumar Jha
 
In-memory No SQL- GIDS2014
In-memory No SQL- GIDS2014In-memory No SQL- GIDS2014
In-memory No SQL- GIDS2014Hazelcast
 
#GeodeSummit - Redis to Geode Adaptor
#GeodeSummit - Redis to Geode Adaptor#GeodeSummit - Redis to Geode Adaptor
#GeodeSummit - Redis to Geode AdaptorPivotalOpenSourceHub
 
Bootstrap SaaS startup using Open Source Tools
Bootstrap SaaS startup using Open Source ToolsBootstrap SaaS startup using Open Source Tools
Bootstrap SaaS startup using Open Source Toolsbotsplash.com
 
12 Factor App: Best Practices for JVM Deployment
12 Factor App: Best Practices for JVM Deployment12 Factor App: Best Practices for JVM Deployment
12 Factor App: Best Practices for JVM DeploymentJoe Kutner
 
Spark Compute as a Service at Paypal with Prabhu Kasinathan
Spark Compute as a Service at Paypal with Prabhu KasinathanSpark Compute as a Service at Paypal with Prabhu Kasinathan
Spark Compute as a Service at Paypal with Prabhu KasinathanDatabricks
 
Bitsy graph database
Bitsy graph databaseBitsy graph database
Bitsy graph databaseLambdaZen LLC
 
Hybrid Apache Spark Architecture with YARN and Kubernetes
Hybrid Apache Spark Architecture with YARN and KubernetesHybrid Apache Spark Architecture with YARN and Kubernetes
Hybrid Apache Spark Architecture with YARN and KubernetesDatabricks
 
Introducing Kubernetes
Introducing Kubernetes Introducing Kubernetes
Introducing Kubernetes VikRam S
 
Apache kafka-a distributed streaming platform
Apache kafka-a distributed streaming platformApache kafka-a distributed streaming platform
Apache kafka-a distributed streaming platformconfluent
 
The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...
The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...
The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...Redis Labs
 
Akka Streams And Kafka Streams: Where Microservices Meet Fast Data
Akka Streams And Kafka Streams: Where Microservices Meet Fast DataAkka Streams And Kafka Streams: Where Microservices Meet Fast Data
Akka Streams And Kafka Streams: Where Microservices Meet Fast DataLightbend
 
Whirlpools in the Stream with Jayesh Lalwani
 Whirlpools in the Stream with Jayesh Lalwani Whirlpools in the Stream with Jayesh Lalwani
Whirlpools in the Stream with Jayesh LalwaniDatabricks
 

What's hot (20)

Using ELK-Stack (Elasticsearch, Logstash and Kibana) with BizTalk Server
Using ELK-Stack (Elasticsearch, Logstash and Kibana) with BizTalk ServerUsing ELK-Stack (Elasticsearch, Logstash and Kibana) with BizTalk Server
Using ELK-Stack (Elasticsearch, Logstash and Kibana) with BizTalk Server
 
Delivering big content at NBC News with RavenDB
Delivering big content at NBC News with RavenDBDelivering big content at NBC News with RavenDB
Delivering big content at NBC News with RavenDB
 
Change data capture with MongoDB and Kafka.
Change data capture with MongoDB and Kafka.Change data capture with MongoDB and Kafka.
Change data capture with MongoDB and Kafka.
 
How Kafka and MemSQL Became the Dynamic Duo (Sarung Tripathi, MemSQL) Kafka S...
How Kafka and MemSQL Became the Dynamic Duo (Sarung Tripathi, MemSQL) Kafka S...How Kafka and MemSQL Became the Dynamic Duo (Sarung Tripathi, MemSQL) Kafka S...
How Kafka and MemSQL Became the Dynamic Duo (Sarung Tripathi, MemSQL) Kafka S...
 
Real-time Data Streaming from Oracle to Apache Kafka
Real-time Data Streaming from Oracle to Apache Kafka Real-time Data Streaming from Oracle to Apache Kafka
Real-time Data Streaming from Oracle to Apache Kafka
 
Low-latency data applications with Kafka and Agg indexes | Tino Tereshko, Fir...
Low-latency data applications with Kafka and Agg indexes | Tino Tereshko, Fir...Low-latency data applications with Kafka and Agg indexes | Tino Tereshko, Fir...
Low-latency data applications with Kafka and Agg indexes | Tino Tereshko, Fir...
 
Event sourcing Live 2021: Streaming App Changes to Event Store
Event sourcing Live 2021: Streaming App Changes to Event StoreEvent sourcing Live 2021: Streaming App Changes to Event Store
Event sourcing Live 2021: Streaming App Changes to Event Store
 
In-memory No SQL- GIDS2014
In-memory No SQL- GIDS2014In-memory No SQL- GIDS2014
In-memory No SQL- GIDS2014
 
#GeodeSummit - Redis to Geode Adaptor
#GeodeSummit - Redis to Geode Adaptor#GeodeSummit - Redis to Geode Adaptor
#GeodeSummit - Redis to Geode Adaptor
 
Bootstrap SaaS startup using Open Source Tools
Bootstrap SaaS startup using Open Source ToolsBootstrap SaaS startup using Open Source Tools
Bootstrap SaaS startup using Open Source Tools
 
12 Factor App: Best Practices for JVM Deployment
12 Factor App: Best Practices for JVM Deployment12 Factor App: Best Practices for JVM Deployment
12 Factor App: Best Practices for JVM Deployment
 
Spark Compute as a Service at Paypal with Prabhu Kasinathan
Spark Compute as a Service at Paypal with Prabhu KasinathanSpark Compute as a Service at Paypal with Prabhu Kasinathan
Spark Compute as a Service at Paypal with Prabhu Kasinathan
 
Bitsy graph database
Bitsy graph databaseBitsy graph database
Bitsy graph database
 
Hybrid Apache Spark Architecture with YARN and Kubernetes
Hybrid Apache Spark Architecture with YARN and KubernetesHybrid Apache Spark Architecture with YARN and Kubernetes
Hybrid Apache Spark Architecture with YARN and Kubernetes
 
Introducing Kubernetes
Introducing Kubernetes Introducing Kubernetes
Introducing Kubernetes
 
Apache kafka-a distributed streaming platform
Apache kafka-a distributed streaming platformApache kafka-a distributed streaming platform
Apache kafka-a distributed streaming platform
 
The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...
The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...
The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...
 
Akka Streams And Kafka Streams: Where Microservices Meet Fast Data
Akka Streams And Kafka Streams: Where Microservices Meet Fast DataAkka Streams And Kafka Streams: Where Microservices Meet Fast Data
Akka Streams And Kafka Streams: Where Microservices Meet Fast Data
 
Whirlpools in the Stream with Jayesh Lalwani
 Whirlpools in the Stream with Jayesh Lalwani Whirlpools in the Stream with Jayesh Lalwani
Whirlpools in the Stream with Jayesh Lalwani
 
Javantura v3 - Real-time BigData ingestion and querying of aggregated data – ...
Javantura v3 - Real-time BigData ingestion and querying of aggregated data – ...Javantura v3 - Real-time BigData ingestion and querying of aggregated data – ...
Javantura v3 - Real-time BigData ingestion and querying of aggregated data – ...
 

Viewers also liked

Patterns and practices for building enterprise-scale HTML5 apps
Patterns and practices for building enterprise-scale HTML5 appsPatterns and practices for building enterprise-scale HTML5 apps
Patterns and practices for building enterprise-scale HTML5 appsPhil Leggetter
 
Praise explosion/ marathon de louange
Praise explosion/ marathon de louangePraise explosion/ marathon de louange
Praise explosion/ marathon de louangeBEATRICE LASSAIGNE
 
Algolia's Fury Road to a Worldwide API - Take Off Conference 2016
Algolia's Fury Road to a Worldwide API - Take Off Conference 2016Algolia's Fury Road to a Worldwide API - Take Off Conference 2016
Algolia's Fury Road to a Worldwide API - Take Off Conference 2016Olivier Lance
 
Chronic pain: Role of tricyclic antidepressants, dolsulepin
Chronic pain: Role of tricyclic antidepressants, dolsulepinChronic pain: Role of tricyclic antidepressants, dolsulepin
Chronic pain: Role of tricyclic antidepressants, dolsulepinSudhir Kumar
 
Assembly level language
Assembly level languageAssembly level language
Assembly level languagePDFSHARE
 
Cecilia jaya larraga investigacion
Cecilia jaya larraga investigacionCecilia jaya larraga investigacion
Cecilia jaya larraga investigacionCecilia Jaya Larraga
 
Matemática proyecto de aula
Matemática proyecto de aulaMatemática proyecto de aula
Matemática proyecto de aulaSamuel López
 
Burning tongue webinar with Dr.Susan Sklar
Burning tongue webinar with Dr.Susan SklarBurning tongue webinar with Dr.Susan Sklar
Burning tongue webinar with Dr.Susan SklarWarren Blesofsky
 
WINK Calgary presents "Learn to love your money - basics of investing"
WINK Calgary presents "Learn to love your money - basics of investing"WINK Calgary presents "Learn to love your money - basics of investing"
WINK Calgary presents "Learn to love your money - basics of investing"Patty Auger, CA, CFP
 

Viewers also liked (13)

Patterns and practices for building enterprise-scale HTML5 apps
Patterns and practices for building enterprise-scale HTML5 appsPatterns and practices for building enterprise-scale HTML5 apps
Patterns and practices for building enterprise-scale HTML5 apps
 
Praise explosion/ marathon de louange
Praise explosion/ marathon de louangePraise explosion/ marathon de louange
Praise explosion/ marathon de louange
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Metodo d inferencia estadistica
Metodo d inferencia estadisticaMetodo d inferencia estadistica
Metodo d inferencia estadistica
 
Comercio internacional
Comercio internacionalComercio internacional
Comercio internacional
 
Algolia's Fury Road to a Worldwide API - Take Off Conference 2016
Algolia's Fury Road to a Worldwide API - Take Off Conference 2016Algolia's Fury Road to a Worldwide API - Take Off Conference 2016
Algolia's Fury Road to a Worldwide API - Take Off Conference 2016
 
Chronic pain: Role of tricyclic antidepressants, dolsulepin
Chronic pain: Role of tricyclic antidepressants, dolsulepinChronic pain: Role of tricyclic antidepressants, dolsulepin
Chronic pain: Role of tricyclic antidepressants, dolsulepin
 
Assembly level language
Assembly level languageAssembly level language
Assembly level language
 
Cecilia jaya larraga investigacion
Cecilia jaya larraga investigacionCecilia jaya larraga investigacion
Cecilia jaya larraga investigacion
 
Las teorías del liderazgo
Las teorías del liderazgoLas teorías del liderazgo
Las teorías del liderazgo
 
Matemática proyecto de aula
Matemática proyecto de aulaMatemática proyecto de aula
Matemática proyecto de aula
 
Burning tongue webinar with Dr.Susan Sklar
Burning tongue webinar with Dr.Susan SklarBurning tongue webinar with Dr.Susan Sklar
Burning tongue webinar with Dr.Susan Sklar
 
WINK Calgary presents "Learn to love your money - basics of investing"
WINK Calgary presents "Learn to love your money - basics of investing"WINK Calgary presents "Learn to love your money - basics of investing"
WINK Calgary presents "Learn to love your money - basics of investing"
 

Similar to James Turner (Caplin) - Enterprise HTML5 Patterns

An Introduction to Web Components
An Introduction to Web ComponentsAn Introduction to Web Components
An Introduction to Web ComponentsRed Pill Now
 
Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .NetRichard Banks
 
#JaxLondon keynote: Developing applications with a microservice architecture
#JaxLondon keynote: Developing applications with a microservice architecture#JaxLondon keynote: Developing applications with a microservice architecture
#JaxLondon keynote: Developing applications with a microservice architectureChris Richardson
 
Developing Applications with a Micro Service Architecture - Chris Richardson
Developing Applications with a Micro Service Architecture - Chris RichardsonDeveloping Applications with a Micro Service Architecture - Chris Richardson
Developing Applications with a Micro Service Architecture - Chris RichardsonJAXLondon2014
 
Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...Chris Richardson
 
Developing applications with a microservice architecture (svcc)
Developing applications with a microservice architecture (svcc)Developing applications with a microservice architecture (svcc)
Developing applications with a microservice architecture (svcc)Chris Richardson
 
Azure Overview Csco
Azure Overview CscoAzure Overview Csco
Azure Overview Cscorajramab
 
ASP.NET Core For The Agile Enterprise
ASP.NET Core For The Agile EnterpriseASP.NET Core For The Agile Enterprise
ASP.NET Core For The Agile EnterpriseDennis Moon
 
cross-platform-assets-based-front-end-architecture
cross-platform-assets-based-front-end-architecturecross-platform-assets-based-front-end-architecture
cross-platform-assets-based-front-end-architectureOleksandr Tserkovnyi
 
xRM - as an Evolution of CRM
xRM - as an Evolution of CRMxRM - as an Evolution of CRM
xRM - as an Evolution of CRMCatherine Eibner
 
WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012Dmitri Artamonov
 
Keynote - The Benefits of an Open Service Oriented Architecture in the Enterpr...
Keynote - The Benefits of an Open Service Oriented Architecture in the Enterpr...Keynote - The Benefits of an Open Service Oriented Architecture in the Enterpr...
Keynote - The Benefits of an Open Service Oriented Architecture in the Enterpr...mfrancis
 
Windows Azure Platform + PHP - Jonathan Wong
Windows Azure Platform + PHP - Jonathan WongWindows Azure Platform + PHP - Jonathan Wong
Windows Azure Platform + PHP - Jonathan WongSpiffy
 
Alfresco Development Framework Basic
Alfresco Development Framework BasicAlfresco Development Framework Basic
Alfresco Development Framework BasicMario Romano
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSAngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSmurtazahaveliwala
 
Serverless Single Page Apps with React and Redux at ItCamp 2017
Serverless Single Page Apps with React and Redux at ItCamp 2017Serverless Single Page Apps with React and Redux at ItCamp 2017
Serverless Single Page Apps with React and Redux at ItCamp 2017Melania Andrisan (Danciu)
 
Windowsazureplatform Overviewlatest
Windowsazureplatform OverviewlatestWindowsazureplatform Overviewlatest
Windowsazureplatform Overviewlatestrajramab
 
Pragmatic Approach to Microservices and Cell-based Architecture
Pragmatic Approach to Microservices and Cell-based Architecture Pragmatic Approach to Microservices and Cell-based Architecture
Pragmatic Approach to Microservices and Cell-based Architecture Andrew Blades
 

Similar to James Turner (Caplin) - Enterprise HTML5 Patterns (20)

An Introduction to Web Components
An Introduction to Web ComponentsAn Introduction to Web Components
An Introduction to Web Components
 
Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .Net
 
#JaxLondon keynote: Developing applications with a microservice architecture
#JaxLondon keynote: Developing applications with a microservice architecture#JaxLondon keynote: Developing applications with a microservice architecture
#JaxLondon keynote: Developing applications with a microservice architecture
 
Developing Applications with a Micro Service Architecture - Chris Richardson
Developing Applications with a Micro Service Architecture - Chris RichardsonDeveloping Applications with a Micro Service Architecture - Chris Richardson
Developing Applications with a Micro Service Architecture - Chris Richardson
 
Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...
 
Developing applications with a microservice architecture (svcc)
Developing applications with a microservice architecture (svcc)Developing applications with a microservice architecture (svcc)
Developing applications with a microservice architecture (svcc)
 
Power
PowerPower
Power
 
7+ Years.Net Resume
7+ Years.Net Resume7+ Years.Net Resume
7+ Years.Net Resume
 
Azure Overview Csco
Azure Overview CscoAzure Overview Csco
Azure Overview Csco
 
ASP.NET Core For The Agile Enterprise
ASP.NET Core For The Agile EnterpriseASP.NET Core For The Agile Enterprise
ASP.NET Core For The Agile Enterprise
 
cross-platform-assets-based-front-end-architecture
cross-platform-assets-based-front-end-architecturecross-platform-assets-based-front-end-architecture
cross-platform-assets-based-front-end-architecture
 
xRM - as an Evolution of CRM
xRM - as an Evolution of CRMxRM - as an Evolution of CRM
xRM - as an Evolution of CRM
 
WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012
 
Keynote - The Benefits of an Open Service Oriented Architecture in the Enterpr...
Keynote - The Benefits of an Open Service Oriented Architecture in the Enterpr...Keynote - The Benefits of an Open Service Oriented Architecture in the Enterpr...
Keynote - The Benefits of an Open Service Oriented Architecture in the Enterpr...
 
Windows Azure Platform + PHP - Jonathan Wong
Windows Azure Platform + PHP - Jonathan WongWindows Azure Platform + PHP - Jonathan Wong
Windows Azure Platform + PHP - Jonathan Wong
 
Alfresco Development Framework Basic
Alfresco Development Framework BasicAlfresco Development Framework Basic
Alfresco Development Framework Basic
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSAngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
 
Serverless Single Page Apps with React and Redux at ItCamp 2017
Serverless Single Page Apps with React and Redux at ItCamp 2017Serverless Single Page Apps with React and Redux at ItCamp 2017
Serverless Single Page Apps with React and Redux at ItCamp 2017
 
Windowsazureplatform Overviewlatest
Windowsazureplatform OverviewlatestWindowsazureplatform Overviewlatest
Windowsazureplatform Overviewlatest
 
Pragmatic Approach to Microservices and Cell-based Architecture
Pragmatic Approach to Microservices and Cell-based Architecture Pragmatic Approach to Microservices and Cell-based Architecture
Pragmatic Approach to Microservices and Cell-based Architecture
 

Recently uploaded

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Recently uploaded (20)

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

James Turner (Caplin) - Enterprise HTML5 Patterns

  • 1. Enterprise HTML5 Patterns AKQA Anorak: June 2013 James Turner Architect james.turner@caplin.com
  • 2. What am I talking about ? What is “enterprise” ? We have replaced, functionally large diverse, desktop thick client trading systems with with “single page” web applications. How we did it ? Architectural patterns and technologies used. Good news for web-devs http://addyosmani.com/resources/essentialjsdesignpatterns/book/
  • 3. Move desktop trading to browsers (1)
  • 4. Move desktop trading to browsers (2)
  • 5. Business Drivers ▶  Increase trade volumes –  Integrate pre-trade information ▶  Reduce cost of sale ▶  Direct channel to customer –  Enhanced user experience –  Branding ▶  Zero deployment: URL to customer –  Reduced onboarding time + cost –  Reduced maintenance
  • 6. Reverse barrier convertibles “10 minutes rather than up to 2 hours on phone with a sales trader”
  • 7. Technology Drivers ▶  Mobile –  Cross device support ▶  Improved browser ecosystem –  Browser performance debugging much better –  Fewer browser differences –  Vibrant open source community ▶  HTML5 –  Local storage, web-sockets, CSS3 … ▶  Death of alternatives –  Flash/Flex, Silverlight
  • 9. The application ▶  “A lot of code” 250k + LOC ▶  Single page “thick client” applications –  Different assumptions –  Runs all day, memory leaks –  UX of lazy loading ▶  Consistency: theming/skinning/UX ▶  Internationalisation ▶  Streaming financial tradable prices –  Screen update performance –  Trade on “displayed price” –  Graceful degradation –  Throttling, scheduling
  • 10. Multiple teams ▶  10-100’s of developers ▶  Multiple independent teams –  Independent versioned deployment lifecycle –  Share some code –  Rest Isolated ▶  Banks are notoriously silo’d by asset class
  • 11. Different cultures ▶  UX/Graphic designers ▶  Web Developers (jQuery anyone) ▶  Product Owners, Product Managers, Business Analysts ▶  Server-side developers –  Decouple dependencies ▶  QA’s (programming QA’s) ▶  Operations –  Deploy artifacts –  Same artifacts for TEST/UAT/PROD –  Directory services Coolness
  • 12. 12
  • 13. Armageddon “Monday morning: Ooops my weekend check-in just changed the background colour of the entire application”
  • 14. How we did it: 1.  Components 2.  Code organization 3.  App structure + patterns 4.  Testing
  • 16. Split by feature, not technology 16 CSS HTML JS config i18n images tests CSS HTML JS config tests images i18n CSS HTML JS config tests images i18n CSS HTML JS config tests images i18n CSS HTML JS config tests images i18n
  • 17. ▶  Independent business feature ▶  No direct dependencies to other components ▶  Minimal public interface –  Event bus (publish/subscribe) –  Component API ▶  Code sharing mechanism –  Libraries –  Modules ▶  Conforms to conventions/name-spacing ▶  Can be pre-built What is a component
  • 19. Workbench Instant reload imperative for developer productivity
  • 20. Conways’Law “Organizations which design systems ... are constrained to produce designs which are copies of the communication structures of these organizations"
  • 21. Code Structure APPLICATION MODULE A COMPONENT 1 COMPONENT 2 MODULE B COMPONENT 3 COMPONENT 4 ASPECTS MOBILE DESKTOP LIBRARIES INC THIRD-PARTY
  • 22. Inheritance + Name-spacing ▶  CSS –  App defines common “theme” –  Components inherit theme –  Override with more specific CSS rules •  Need name-spacing –  Use CSS pre-processor (e.g. LESS,SASS) –  Define an ontology ▶  XML/HTML –  Name-spacing for unique ID’s
  • 23. JavaScript Coding ▶  Fine grained OO –  We average about 100 LOC per class ▶  One class per file ▶  Design patterns ▶  SOLID (Uncle Bob) ▶  Coding standards –  Inheritance –  JsHint ▶  Common code in libraries ▶  Interpreted: so testing is more important ▶  JsLint /coverage
  • 24. Bundling dev-server bundling (enforcement) APPLICATIO N BLADESET A BLADE 1 BLADE 2 BLADESET B BLADE 1 BLADE 2 ASPECTS MOBILE DESKTOP ProjectsEclipse IntelliJ Sublime NetBeans Vi/Emacs …….. IDE of choice running app J2EE ServerWAR deploy ZIP CDN Directory services
  • 26. JavaScript Interfaces ▶  Defines the contract a component should conform to. –  A set of method signatures ▶  Multiple classes “implement” the same interface ▶  Provides a hook for documentation ▶  Hook for IDE tooling
  • 27. Service Registry var service = new caplin.XhrXmlResourceServiceProvider(this.sXmlBundleUrl); caplin.ServiceRegistry.register("caplin.XmlResourceService”, service); var xmlResourceService = caplin.ServiceRegistry.getService("caplin.XmlResourceService"); var tradeModelNode = xmlResourceService.getXmlDocument("tradeModels"); Registration: Usage:
  • 28. Event Hub ▶  Publish/Subscribe inside the browser –  Many to many (or none) ▶  Defined by an interface (contract) ▶  Methods cannot return anything ▶  Classic example: logging ▶  Nice Article: http://blog.caplin.com/2012/12/07/event-hub-pubsub-in-the-browser/
  • 29. Component Interface ▶  Used by layout managers to manage GUI components ▶  Defines GUI lifecycle events –  getElement(), –  onOpen(), –  onResize(), –  onSerialize() etc.
  • 30. MVVM Pattern ViewRendering to screen Domain Model business semantic method callslistens Reused across many screens View Model gestureslistens Logical representation of the view (an adaptor)
  • 31. <button class=‘..’ data-bind=‘click:buttonClicked’> Execute Trade </button> HTML template with bindings $(button).click(function(){ vm.buttonClicked() }); jQuery Control Our HTML5 MVVM Domain Model executeTrade()complete() Message Service send()receive() View Model buttonClicked()tradeButtonEnabled No DOM Access XmlHttpRequest binding framework e.g. KnockoutJs
  • 32. The Testing Triangle Functional GUI testing ITs Unit Tests manual Acceptance Tests Performance Tests Integration Tests - Selenium - (automated manual tests) Unit Tests manual Performance Tests
  • 33. Test by contract Browser GUI logicaluseractions servicecalls Given “form is opened” When “user executes trade” Then “trade message sent to server” Server Code RESTfulAPI Given “server is started” When “trade message received” Then “money is sent somewhere”
  • 34. Test by contract MVVM and services View Model Domain Model complete() View execute() Given … When … Then … Fixtures executeTrade() tradeButtonEnabled Message Service Stub send() receive()
  • 35. Test Infrastructure js-test-driver Server Bundlers JavaScript Dependencies jsTestDriver.conf plugin: - name: "BundleInjector" jar: …/js-jstd-plugin.jar module: com.caplin.jstd.BundlerPlugin load: - bundles/i18n/en_i18n.bundle - bundles/js/js.bundle test: - tests/**.js serve: - bundles/html.bundle - bundles/xml.bundle Plugin JavaScript Test Files HTML/XML Dependencies
  • 36. In summary: divide + conquer Natural fine grained OO coding Components Common code in libraries Split GUI Code into Dom interactions View Model Domain Model Services for stubbing GWT + Test by contract
  • 37. We will soon be open-sourcing our implementation of this architecture www.bladerunnerjs.org