SlideShare a Scribd company logo
Component-based
Frontend Architecture
Zaiyang, Steve, Alex, Dave
What are Our
Goals?
● Discuss frontend architecture
● Frameworks?
● Why Component-based architecture is
good
● Angular’s approach to components
● Good JavaScript tools and libraries
Traditional MVC (n-tiered)
Architecture Tries to be Loosely
Coupled
● Separation of concern
● App is divided into layers:
Model, View, Controller,
Service, Persistence,
Networking, etc.
But MVC has lots of
disadvantages:
Complexity, Fragility,
Non-reusable.
Difficult to extend existing
functionality
MVC is DEAD
FAREWELL TO MVC
Component-
based
Frameworks
Ember.js
Vue.js
Angular 2
React.js
Polymer
What is a
component?
A component is a
self-contained
object which owns
its own presentation
logic, view, and
internal state
Example: Button<button>
A Component
owns its state
A Component
knows how to
render itself
View = template + state
A Component
is reusable
They can be
composed
<ul>
<li><button>hello</button></li>
</ul>
Component based architecture
function HeaderController($scope, $element, $attrs){
//...
}
angular.module(‘myApp’)
.component(‘header’,{
template: `<h1>{{ header.title }}</h1>`,
controller: HeaderController,
controllerAs: ‘header’
bindings: {
‘title’: ‘@’
}
});
//….
//
<header title=”Pet Shop”></header>
Angular’s Component Approach
One-way Data Flow
Model
Input Field
Value = ‘hello’
Parent
Child.onchange <- parent.textChanged
parent.onchange(newValue)
Value = ‘hello’
textChanged()
Child.value <- parent.value
Input Field
value=’hello’
Parent
Parent.value = child.value
value=’hello’
$scope.$watch(...)
Don’t use two-way data
binding
Avoid Two-way data binding as
much as possible
Two-way databinding creates tight
coupling between components
Angular watchers creates
performance issues ~ upper limit
2000
What about
Application state?
Services?
Controller?
View? X
Maybe
Maybe
What about
Application state?
Components!
Container
Component
Presentation
Component
Centralized
Application Store
Other
Architectural
paradigms
Reactive (Rx)
Flux/Redux
Functional

More Related Content

PPTX
From MVC to Component Based Architecture
PPTX
Process and Project Metrics-1
PPTX
Software architecture and software design
PDF
An Introduction to Software Architecture
PPTX
Ch6 architectural design
PPSX
Role of BA in Testing
PPT
From MVC to Component Based Architecture
Process and Project Metrics-1
Software architecture and software design
An Introduction to Software Architecture
Ch6 architectural design
Role of BA in Testing

What's hot (20)

PPT
Software architecture
PDF
Software Bill of Materials - Accelerating Your Secure Embedded Development.pdf
 
PPTX
Software Architecture
PPT
ALM (Application Lifecycle Management)
PDF
Introduction to SOFTWARE ARCHITECTURE
PPTX
Ch16 component based software engineering
PPTX
Ch25 configuration management
PPT
Software System Engineering - Chapter 2
PPTX
Software Quality Attributes
PPTX
New Roles In The Cloud
PPTX
2022 August Patch Tuesday
PPTX
Unit 7 performing user interface design
PPTX
Microsoft azure
PPTX
Design Pattern - MVC, MVP and MVVM
PPT
Software Quality Assurance
PPTX
Software development
PPTX
Windows Azure Virtual Machines
PPTX
N-tier Application Developement
PDF
Component Based Development
PDF
software engineering
Software architecture
Software Bill of Materials - Accelerating Your Secure Embedded Development.pdf
 
Software Architecture
ALM (Application Lifecycle Management)
Introduction to SOFTWARE ARCHITECTURE
Ch16 component based software engineering
Ch25 configuration management
Software System Engineering - Chapter 2
Software Quality Attributes
New Roles In The Cloud
2022 August Patch Tuesday
Unit 7 performing user interface design
Microsoft azure
Design Pattern - MVC, MVP and MVVM
Software Quality Assurance
Software development
Windows Azure Virtual Machines
N-tier Application Developement
Component Based Development
software engineering
Ad

Viewers also liked (6)

PPTX
Dive into Angular, part 2: Architecture
PPTX
AngularJS 2.0
PDF
Component Based UI Architecture - Alex Moldovan
PDF
Reactive.architecture.with.Angular
PPTX
Angular 2 - Better or worse
PPTX
AngularJS Architecture
Dive into Angular, part 2: Architecture
AngularJS 2.0
Component Based UI Architecture - Alex Moldovan
Reactive.architecture.with.Angular
Angular 2 - Better or worse
AngularJS Architecture
Ad

Similar to Component based architecture (20)

PPTX
Mvc ppt
PPTX
Mobile App Architectures & Coding guidelines
PDF
PPTX
Making the switch to angular js
PPTX
5_6163495906206292160 for study purpose.pptx
PDF
AngularJS - introduction & how it works?
PPT
Code Camp 06 Model View Presenter Architecture
PPTX
AngularJs (1.x) Presentation
PDF
MV(C, mvvm) in iOS and ReactiveCocoa
PPTX
Spring mvc
DOC
Resume joseph gregory java
PDF
MVC Architecture: A Detailed Insight to the Modern Web Applications Developme...
PPTX
MVC.pptx
PPTX
Software Architecture vs design
DOC
Resume joseph gregory java
PPTX
Building databound JavaScript apps with Knockoutjs
PDF
AngularJS Basics - Knowledge Sharing
PPTX
Angular js
PPTX
Angular js
DOCX
IntroductionToMVC
Mvc ppt
Mobile App Architectures & Coding guidelines
Making the switch to angular js
5_6163495906206292160 for study purpose.pptx
AngularJS - introduction & how it works?
Code Camp 06 Model View Presenter Architecture
AngularJs (1.x) Presentation
MV(C, mvvm) in iOS and ReactiveCocoa
Spring mvc
Resume joseph gregory java
MVC Architecture: A Detailed Insight to the Modern Web Applications Developme...
MVC.pptx
Software Architecture vs design
Resume joseph gregory java
Building databound JavaScript apps with Knockoutjs
AngularJS Basics - Knowledge Sharing
Angular js
Angular js
IntroductionToMVC

Component based architecture