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

PPT
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
PPTX
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOS
PDF
Software Engineering - chp5- software architecture
PPTX
MVVM presentation
PPTX
ASP.NET MVC Presentation
PDF
What is Kubernets
PPTX
Design engineering
PDF
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOS
Software Engineering - chp5- software architecture
MVVM presentation
ASP.NET MVC Presentation
What is Kubernets
Design engineering

What's hot (20)

PPT
Software Design Patterns
PPT
Object Oriented Analysis and Design
PPTX
Model view controller (mvc)
PPTX
Snowflake Automated Deployments / CI/CD Pipelines
ZIP
Unified Process
PPT
Object Oriented Analysis and Design with UML2 part1
PPTX
Software architecture in an agile environment
PPTX
Software architecture patterns
PPT
Software Project Management (lecture 3)
PPTX
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
PPTX
Introducing DevOps
PPTX
MVVM - Model View ViewModel
PPTX
requirement documentation
PPT
Software Project Managment
PPTX
Introduction to microservices
PPT
Requirements analysis
PPTX
Object oriented analysis &design - requirement analysis
PPT
Design engineering
PPTX
MVVM ( Model View ViewModel )
Software Design Patterns
Object Oriented Analysis and Design
Model view controller (mvc)
Snowflake Automated Deployments / CI/CD Pipelines
Unified Process
Object Oriented Analysis and Design with UML2 part1
Software architecture in an agile environment
Software architecture patterns
Software Project Management (lecture 3)
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
Introducing DevOps
MVVM - Model View ViewModel
requirement documentation
Software Project Managment
Introduction to microservices
Requirements analysis
Object oriented analysis &design - requirement analysis
Design engineering
MVVM ( Model View ViewModel )
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)

PDF
Dumb and smart components + redux (1)
PPTX
ComponentOrientedArchitectureWithAngular2 -WithFonts
PDF
Angular Rebooted: Components Everywhere
PDF
Angular Rebooted: Components Everywhere - Carlo Bonamico, Sonia Pini - Codemo...
PDF
Commit University - Exploring Angular 2
PPTX
Fluxish Angular
PDF
WebCamp: Developer Day: Архитектура приложений на основе компонентов - Артем ...
PDF
Component Based Development
PDF
Component-based Front-End architecture
PDF
Front End Development for Back End Developers - vJUG24 2017
PDF
Angular ❤️CMS
PDF
AngularJS in Production (CTO Forum)
PDF
Front end architecture patterns
PDF
Flexible UI Components for a Multi-Framework World
PDF
Flexible UI Components for a Multi-Framework World
PDF
Smart and Dumb Components
PDF
I - Front-end Spectrum
PDF
The State of Front-end At CrowdTwist
PPTX
Engineering Frontends
PPTX
Angular Framework.pptx
Dumb and smart components + redux (1)
ComponentOrientedArchitectureWithAngular2 -WithFonts
Angular Rebooted: Components Everywhere
Angular Rebooted: Components Everywhere - Carlo Bonamico, Sonia Pini - Codemo...
Commit University - Exploring Angular 2
Fluxish Angular
WebCamp: Developer Day: Архитектура приложений на основе компонентов - Артем ...
Component Based Development
Component-based Front-End architecture
Front End Development for Back End Developers - vJUG24 2017
Angular ❤️CMS
AngularJS in Production (CTO Forum)
Front end architecture patterns
Flexible UI Components for a Multi-Framework World
Flexible UI Components for a Multi-Framework World
Smart and Dumb Components
I - Front-end Spectrum
The State of Front-end At CrowdTwist
Engineering Frontends
Angular Framework.pptx

Component based architecture