SlideShare uma empresa Scribd logo
1 de 71
Baixar para ler offline
Journey Through The JavaScript
MVC Jungle
Baris Aydinoglu
July 30, 2015
Agenda:
Spaghetti to Ravioli
What is MVC?
MVC vs MVP vs MVVM
Top 5 MVC Frameworks
Suggested Criteria for Selection
Spaghetti
to
Ravioli
The Main Problems:
Where the one block of code begins and
where the other ends?
The Main Problems:
Where the one block of code begins and
where the other ends?
Violates SRP (Single Responsibility Principle)
The Main Problems:
Where the one block of code begins and
where the other ends?
Violates SRP (Single Responsibility Principle)
Global scope pollution
The Main Problems:
Where the one block of code begins and
where the other ends?
Violates SRP (Single Responsibility Principle)
Global scope pollution
Violates DRY (Don’t Repeat Yourselt)
The Main Problems:
Where the one block of code begins and
where the other ends?
Violates SRP (Single Responsibility Principle)
Global scope pollution
Violates DRY (Don’t Repeat Yourselt)
Not easy to maintain, test and debug
Spaghetti Example
Ravioli Example
What is MVC?
Model
Model
View
updates
Model
View
updates
User
sees
Model
View
updates
User
sees
Controller
uses
manipulates
”Easier overall maintenance.
”Decoupling models and views &
easy unit tests.
”Eliminates duplication of
low-level model and controller
code.
”Allows core developers and UI
developers work simultaneously.
MVC:
View
Controller
Model
”View can access entire Model.
(security and performance costs)
”Controller can be shared across
views.
”Controller can be responsible for
determining which view to
display.
MVP:
View
Presenter
Model
”View is more loosely coupled to
the Model.
”View to Presenter map one to
one. (usually)
”Complex Views may have multi
Presenters.
MVVM:
View
Data Binding
ViewModel
Model
”ViewModel is not required.
Top 5
MVC
Frameworks
Backbone.js:
Provides models with key-value binding and
custom events, collections, and connects it all
to your existing API over a RESTful JSON
interface.
The job of the controller tends to more be done
partially by Views and Routers
Views contain UI logic along with representing
data
Pros:
Extensive documentation
Strong community and lots of momentum
Routers map URLs to functions
Underscore.js (which it uses heavily) is also
a great framework
Cons:
Lacks strong abstractions and leaves
something to be desired
The entire framework is surprisingly
lightweight and results in lots of boilerplate
The larger an application becomes, the
more this becomes apparent
Ember.js:
Provides template written in the Handlebars
templating language, views, controllers, models
and a router.
Ember’s main features are its data binding
Objects can bind properties to each other, so the
objects are kept in sync
Automatically updates its views when data changes
Views usually written in Handlebars.js
Pros:
Extremely rich templating system with
composed views and UI bindings
Cons:
Relatively new
Documentation leaves lots to be desired
AngularJS:
A toolset based on extending the HTML
vocabulary for your application.
Google’s offering
Data binding directly in HTML
Its data binding is bi-directional
Angular leaves you with much leaner controllers
and less JavaScript to write
Pros:
Very well thought out with respect to
template scoping and controller design
Has a dependency injection system
Supports a rich UI-Binding syntax to make
things like filtering and transforming values
a breeze
Cons:
Codebase appears to be fairly sprawling
and not very modular
Knockout:
Aims to simplify JavaScript UIs by applying the
Model-View-View Model (MVVM) pattern.
It is a MVVM (Model-View-View Model) framework
written in pure JavaScript
Bindings inserted as attributes similar to Angular.js
Pros:
Binding support
Great documentation and amazing tutorial
system
Performance
Cons:
Awkward binding syntax and lacks a solid
view component hierarchy
Batman.js:
A framework for building rich web applications
with CoffeeScript.
Written in CoffeeScript
It can be used with JavaScript or CoffeeScript
Your code will look much cleaner in CoffeeScript
Wrapper class includes Controller and Models
Batman uses data-bindings in the Views
Pros:
Very clean codebase
Has a nice simple approach to binding,
persistence, and routing
Cons:
Singleton controllers are not efficient
Suggested Criteria
for Selection
”What is the framework really
capable of?
”Has the framework been proved
in production?
”Is the framework mature?
”Is the framework flexible or
opinionated?
”Have you really played with the
framework?
”Does the framework have a
comprehensive set of
documentation?
”What is the total size of the
framework, factoring in
minification, gzipping and any
modular building that it
supports?
”Have you reviewed the
community around the
framework?
Figure: TodoMVC, Helping you select an MV* framework
Go Deeper:
www. infoq. com/ research/ top-javascript-mvc-frameworks
todomvc. com
backbonejs. org
emberjs. com
angularjs. org
knockoutjs. com
batmanjs. org
?
That’s all Folks!
@barisaydinoglu
github.com/barisaydinoglu
baris@aydinoglu.info

Mais conteúdo relacionado

Mais procurados

Mvc presentation
Mvc presentationMvc presentation
Mvc presentation
MaslowB
 

Mais procurados (20)

ASP.NET MVC difference between questions list 1
ASP.NET MVC difference between questions list 1ASP.NET MVC difference between questions list 1
ASP.NET MVC difference between questions list 1
 
Difference between wcf and asp.net web api
Difference between wcf and asp.net web apiDifference between wcf and asp.net web api
Difference between wcf and asp.net web api
 
ASP.NET MVC for Begineers
ASP.NET MVC for BegineersASP.NET MVC for Begineers
ASP.NET MVC for Begineers
 
MVC Architecture in ASP.Net By Nyros Developer
MVC Architecture in ASP.Net By Nyros DeveloperMVC Architecture in ASP.Net By Nyros Developer
MVC Architecture in ASP.Net By Nyros Developer
 
What’s new in Visual Studio 2012 & .NET 4.5
What’s new in Visual Studio 2012 & .NET 4.5What’s new in Visual Studio 2012 & .NET 4.5
What’s new in Visual Studio 2012 & .NET 4.5
 
ColdFusion 11 New Features
ColdFusion 11 New FeaturesColdFusion 11 New Features
ColdFusion 11 New Features
 
MVx patterns in iOS (MVC, MVP, MVVM)
MVx patterns in iOS (MVC, MVP, MVVM)MVx patterns in iOS (MVC, MVP, MVVM)
MVx patterns in iOS (MVC, MVP, MVVM)
 
ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines  ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines
 
Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4
 
10 things to remember
10 things to remember10 things to remember
10 things to remember
 
What's new in selenium 4
What's new in selenium 4What's new in selenium 4
What's new in selenium 4
 
Difference between asp.net web api and asp.net mvc
Difference between asp.net web api and asp.net mvcDifference between asp.net web api and asp.net mvc
Difference between asp.net web api and asp.net mvc
 
Mvc presentation
Mvc presentationMvc presentation
Mvc presentation
 
MVVM presentation
MVVM presentationMVVM presentation
MVVM presentation
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Php framework
Php frameworkPhp framework
Php framework
 
Webforms or MVC
Webforms or MVCWebforms or MVC
Webforms or MVC
 
Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architecture
 
Visual Studio ❤ JavaScript
Visual Studio ❤ JavaScriptVisual Studio ❤ JavaScript
Visual Studio ❤ JavaScript
 
What is MVC?
What is MVC?What is MVC?
What is MVC?
 

Semelhante a Journey Through The Javascript MVC Jungle

JavaScript MVC Frameworks: Backbone, Ember and Angular JS
JavaScript MVC Frameworks: Backbone, Ember and Angular JSJavaScript MVC Frameworks: Backbone, Ember and Angular JS
JavaScript MVC Frameworks: Backbone, Ember and Angular JS
Harbinger Systems - HRTech Builder of Choice
 

Semelhante a Journey Through The Javascript MVC Jungle (20)

AngularJS - A Powerful Framework For Web Applications
AngularJS - A Powerful Framework For Web ApplicationsAngularJS - A Powerful Framework For Web Applications
AngularJS - A Powerful Framework For Web Applications
 
Comparative analysis of java script framework
Comparative analysis of java script frameworkComparative analysis of java script framework
Comparative analysis of java script framework
 
Javascript Client & Server Architectures
Javascript Client & Server ArchitecturesJavascript Client & Server Architectures
Javascript Client & Server Architectures
 
angularjs-vs-angular-the-key-differences-between-javascript-and-typescript
angularjs-vs-angular-the-key-differences-between-javascript-and-typescriptangularjs-vs-angular-the-key-differences-between-javascript-and-typescript
angularjs-vs-angular-the-key-differences-between-javascript-and-typescript
 
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptxangularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
 
9 Best JavaScript Frameworks To Choose
9 Best JavaScript Frameworks To Choose9 Best JavaScript Frameworks To Choose
9 Best JavaScript Frameworks To Choose
 
Model View Madness
Model View MadnessModel View Madness
Model View Madness
 
Javascript frameworks
Javascript frameworksJavascript frameworks
Javascript frameworks
 
JavaScript - Kristiansand PHP
JavaScript - Kristiansand PHPJavaScript - Kristiansand PHP
JavaScript - Kristiansand PHP
 
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptxangularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptxangularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
 
Mvc part 1
Mvc part 1Mvc part 1
Mvc part 1
 
AngularJS Anatomy & Directives
AngularJS Anatomy & DirectivesAngularJS Anatomy & Directives
AngularJS Anatomy & Directives
 
Top 10 Javascript Frameworks For Easy Web Development
Top 10 Javascript Frameworks For Easy Web DevelopmentTop 10 Javascript Frameworks For Easy Web Development
Top 10 Javascript Frameworks For Easy Web Development
 
MVC Architecture: A Detailed Insight to the Modern Web Applications Developme...
MVC Architecture: A Detailed Insight to the Modern Web Applications Developme...MVC Architecture: A Detailed Insight to the Modern Web Applications Developme...
MVC Architecture: A Detailed Insight to the Modern Web Applications Developme...
 
MVC Framework
MVC FrameworkMVC Framework
MVC Framework
 
MVC - Introduction
MVC - IntroductionMVC - Introduction
MVC - Introduction
 
Asp.net mvc 5 course module 1 overview
Asp.net mvc 5 course   module 1 overviewAsp.net mvc 5 course   module 1 overview
Asp.net mvc 5 course module 1 overview
 
JavaScript MVC Frameworks: Backbone, Ember and Angular JS
JavaScript MVC Frameworks: Backbone, Ember and Angular JSJavaScript MVC Frameworks: Backbone, Ember and Angular JS
JavaScript MVC Frameworks: Backbone, Ember and Angular JS
 

Último

Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Marc Lester
 

Último (20)

Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 
Test Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdfTest Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdf
 
architecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfarchitecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdf
 
Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...
Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...
Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
 
The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)
 
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
 
Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?
 
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
 
Encryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key ConceptsEncryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key Concepts
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
 
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
 
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
GraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with Graph
GraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with GraphGraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with Graph
GraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with Graph
 
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
 
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jGraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
 
Microsoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdfMicrosoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdf
 

Journey Through The Javascript MVC Jungle