2. 2
What are
the key questions
when developing an SPA?
What are
the key questions
when developing an SPA?
3. What’s an SPA?
1. A page is not completely reloaded
2. HTML is generated by client side JS
3. Client side state is stored with JS objects
3
Web
Page
SPA
Complexity
Low
High
22. 3. Architecture
3.1. HOW TO STRUCTURE GUI?
3.2. HOW TO KEEP DATA?
3.3. HOW TO PUT THINGS TOGETHER?
22
23. Web Module
1. Works independently from other web modules
2. Works within the “sandbox”
3. Has limited knowledge regarding the whole application
4. Is managed by a web module manager
23
Scalable JavaScript Application Architecture (by Nicholas Zakas)
Web Module = HTML + CSS + JS
24. Web Modules: Base Idea
24
Web Module 1 Web Module 2
Web Modules Manager
Manages a web module
life cycle
Manages collaboration
among modules
Web Module Context
Everything a web
module knows about
the application
Manage user’s
interaction
Don’t know about
each other
Web Module
↓
an independent
part of GUI
26. Parent & Child Web Modules
26
Parent
Child
Communication between parent and child
Child'slife cycle management
1: Register(context, eventHandlers)
3: Invoke a child'smethod()
2: Unregister()
4: Raise an event()
27. Web Module: Quality Criterion
27
How much is a web module depended from
the other web modules?