SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Downloaden Sie, um offline zu lesen
Ember
Build an ambitious application
By : Chandrasekar.G
What is Ember ?
Ember is an open source javascript framework.
Collection of libraries that are written in pure MVC architectural pattern.
Why Ember ?
Avoid boilerplate codes .
Creates a standard application architecture .
Designed and developed to create and manage large web applications.
Dynamic data bindings.
Ember follows pure MVC Architectural pattern that

Improves application testability .

Keeps application codes modular.
Previous development
In a Software Application , User interface get change often
more than logics and data. Application might be have several
parts / state ,So each state of application may have different
layout , data displaying styles. So each time user navigate
these things are get shuffle when application state change.
In the previous programming development business logics and
presentation logics are tightly coupled in the codes of JSP and
JS files .
Disadvantages
New development
In the new development data logics , business logics and
presentation logics are get separated with modular
programming pattern.
One the main benefit of the decoupling is application will have
ability to develop an independent presentation application .
Architectural pattern
Architectural pattern is a solution to solve design problem .
Architectural pattern which gives the clear pictures about application
system.
It describes the subsystems and components of the application and
relation between them.
In software world which used to address different kind of issues such as :-

Performance 

Security
Architectural patterns
Model - View - Controller
Model - View - Adapter
Model - View - View Model
Some list of architectural patterns which used in software applications.
MVC Overview
Model

The model component covers the list application parts :-

Data.

Set of rules to store data in structure. 

Logics and functions.
View

View component represents the model in different types such as 

Chart 

Pivot 

User customised view
Controller

The Controller component behaves like a mediator which sends the commands to 

View and Model.
MVC software design pattern has divided as three components Model, View Controller.
MVC Good Explanation
This explanation found on stackoverflow.com.
View : "Hey, controller, the user just told me he wants item 4 deleted."
Controller : "Hmm, having checked his credentials, he is allowed to do that... 

Hey, model, I want you to get item 4 and do whatever you do to delete it."
Model : "Item 4... got it. It's deleted. Back to you, Controller."
Controller : "Here, I'll collect the new set of data. Back to you, view."
View : "Cool, I'll show the new set to the user now."





By : Andres Jaan Tack
Software design layer
Book for special offer
Name
Contact
Address
Submit Cancel
ViewModel Controller
Reset Form
Update Form
Cancel
Starting with Ember
Requirements 

jquery.js

ember.js

handlebars.js

ember-data.js
Understanding Ember
Template

In Ember, Template concept is used to define user interface of the application
Router

Router is an Ember class which manages the application state .
View / Components 

View class is responsible for data binding with support of templates.

One more option which provides that developer can implement DOM events for the
user interactions .
Model

Model is a class that defines properties , structure and behaviour of the data.
Controller

Ember controllers usually consist the code to execute the tasks.
Core concept of Ember
Template
Template is basically a rear surface of model or presentation.
One of the advantage of using template library is when the model get change
template also get change automatically.
Template engines are written in UI data binding software design pattern.
Ember supports handlebars template engine by default , though which provides
flexibility to use other templates engine such emblem and etc… .
Dynamic UI data binding
Some example Client side template engines 

Emblem

Underscore JS template 

Mustache JS

EJS

Dust JS

Handlebars
Handlebars JS takes the given HTML string and It’s own language syntax
codes and compiles them to the javascript method.
Handlebars JS is an extension of Mustache JS template engine and
developed to supersede mustache JS.
Logic-less template engine.
Using handlebars JS
Defining simple handlebar template
<script id=“template” type=“text/x-handlebars”>
Welcome, <b> {{user.name}} </b>
</script >
“ {{ }} ” expression represents template 

model data as HTML
Example : Simple handlebar template
<script>
var context = {
user : { name : "Jack Sparrow"}
}
var templatecontent = $("#template").html();

var template = Handlebars.compile(templatecontent);
$('body').append(template(context));
</script>
Getting template by ID
Compiler makes template function
Passing the data as parameter in
the template function
Handlebars Helpers
Block Helpers

Handlebars JS provide predefined block level expressions such as conditional

statements and loops.
Custom Helper

Handlebars JS allows developer to create their own helper with option of resister helper
Actions Helpers

Handlebars actions helpers are mainly implemented to handle DOM events. 

Actions related codes will be maintain in the controllers.
View Helper

View helper is used to define template with help of view class .. will be cover on ember view
Template Helpers

There are three expression “ template “, “ partial ” and “render” which are used to includes 

specific template in the context .
Outlet

Outlet helper tells to render the route related template and allows to render child templates.
Handlebars JS has some expressions for dynamic data binding
Using Block helpers

<div class={{#if alreadyVisited}} "alreadyVisited"{{/if}} "notVisited">
	 {{name}}
</div>
Example : Conditional statements
Conditional statements If, else, unless
Each
{{#each bookmarks}}
!
{{/each}}
<div class="visitedUsers">
<br> <b> Visited user</b> :
{{#unless visitedUser.length}}
No one visited yet this site
{{else}}
{{visitedUser}}
{{/unless}}
</div>
Note : Else if conditions are not supported
Example : Each in Handlebar
with
with is a block helper which helps to change the context of the template .
Example : "with" Block helper
{{#with otherActivities}}
{{sports}}
<br>
{{music}}
{{/with}}
Custom Helpers
Handlebars.registerHelper("createController", function (string){
return string+"Controller = Em.Controller.extend({})";
});
Example : Custom Block helper
Following below codes will create a new helper called creteController 

so developer can use In that template
Ember Application
var App = Em.Application.create();
Creating Application
Following code will create the instance of ember application. Application provides some
default package of components.
!
We can implement application view with the help of handlebar like following code
!
	 	 <script type=“text/x-handlebars” >	 	 	 	
	 	 	 HTML code goes here
	 	 </script>
!
If we don’t mention any ID in It will render the application view .
Basically It makes the body element as ember application .Instead of body element
We can specify the Application view element with option of rootElement.
var App = Em.Application.create({
	 rootElement : “main”
});
Debug configuration
LOG_STACKTRACE_ON_DEPRECATION 	: 	 true,
LOG_BINDINGS 	 	 	 	 : 	 true,
LOG_TRANSITIONS 	 	 	 : 	 true,
LOG_TRANSITIONS_INTERNAL 	 	 : 	 true,
LOG_VIEW_LOOKUPS 	 	 	 : 	 true,
LOG_ACTIVE_GENERATION 	 	 : 	 true
{{debugger}}
Following code will throw the error in template
Get logs of specified layer
{{log controller}}
List of properties are available for logging
Router
Ember router class store the application state in browser’s URL.
Ember creates router object on application loads named App.Router.
Routes classes are generates with ember UpperCamelCase
convention.
Application router comes by default with the set of route objects
called IndexRoute and ApplicationRoute.
ApplicationRoute will load in the all resource by default.
Router in Action
App.Router.map(function(){});
App.Router loads IndexRouter and ApplicationRoute
We can create routes with the option of “resource” and “route”. 

We can override IndexRouter and ApplicationRouter to make more functionality to the application.

App.IndexRoute = Em.Route.extend({
init : function() {
console.log("Index Route loading ");
}
});
App.ApplicationRoute = Em.Route.extend({
init : function() {
console.log("Application Route loading ");
}
});
Defining Route
App.Router.map(function(){
this.resource("users");
this.resource(“user",{path:"users/:id"});
});
This code will create users route
This code will create dynamic segments
Example : Route and Dynamic route
So the generated routes are would be UsersRoute, UserRoute , So the
application states are would be access through the URL 



1. http://app/users/
2. http://app/users/ 1
Application
Router
Resource Route
View
On Application load ember creates Application view and parallel application template by default.

Creating View
App.CustomView = Em.View.extend({
classNames: [‘customView']
tagName : “span”
click 	 : function (){
}
});
This code will create View class instance
{{#view App.CustomView}}
Custom View
{{/view}}
Rendering template view helper
Example : Defining view
Ember Application view lifecycle
Application
Views
Container
Ember -Handlebar
Handlebar compiler
Metamorph
<script >
handlebars
Renders HTML
Model
Defining Ember model
App.Info = DS.Model.extend({}); This code will create the model instance
Defining attributes
App.Info = DS.Model.extend({

name : DS.attr('string'),
version : DS.attr('number'),
author : DS.attr('string'),

hasReleased : DS.attr(‘boolean’ , {defaultValue: false})

});
Defining data key and It’s type
Setting default
Example : Example model
Controller
Ember JS controllers provides developer to write and present data with display logics .
Defining action using controller
28
App.PipeController = Em.Controller.extend({
title : "Manage your pipes",
actions : {
pipeNow : function (){
console.log("You can pipe now ",this.get('pipeNow'));
}
},
});
Here the logic codes go
Example :
Example of Controller
action
Basics ends here

Weitere ähnliche Inhalte

Was ist angesagt?

Angular js presentation at Datacom
Angular js presentation at DatacomAngular js presentation at Datacom
Angular js presentation at DatacomDavid Xi Peng Yang
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) PresentationRaghubir Singh
 
Struts Introduction Course
Struts Introduction CourseStruts Introduction Course
Struts Introduction Courseguest764934
 
Design Patterns in ZK: Java MVVM as Model-View-Binder
Design Patterns in ZK: Java MVVM as Model-View-BinderDesign Patterns in ZK: Java MVVM as Model-View-Binder
Design Patterns in ZK: Java MVVM as Model-View-BinderSimon Massey
 
Hastening React SSR - Web Performance San Diego
Hastening React SSR - Web Performance San DiegoHastening React SSR - Web Performance San Diego
Hastening React SSR - Web Performance San DiegoMaxime Najim
 
Introducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverIntroducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverSpike Brehm
 
當ZK遇見Front-End
當ZK遇見Front-End當ZK遇見Front-End
當ZK遇見Front-End祁源 朱
 
Angular Project Report
 Angular Project Report Angular Project Report
Angular Project ReportKodexhub
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - IntroductionSagar Acharya
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedStéphane Bégaudeau
 
Introduction of angular js
Introduction of angular jsIntroduction of angular js
Introduction of angular jsTamer Solieman
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Tuna Tore
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular jsMindfire Solutions
 

Was ist angesagt? (20)

Angular js presentation at Datacom
Angular js presentation at DatacomAngular js presentation at Datacom
Angular js presentation at Datacom
 
Angular js
Angular jsAngular js
Angular js
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
 
Struts Introduction Course
Struts Introduction CourseStruts Introduction Course
Struts Introduction Course
 
Design Patterns in ZK: Java MVVM as Model-View-Binder
Design Patterns in ZK: Java MVVM as Model-View-BinderDesign Patterns in ZK: Java MVVM as Model-View-Binder
Design Patterns in ZK: Java MVVM as Model-View-Binder
 
Hastening React SSR - Web Performance San Diego
Hastening React SSR - Web Performance San DiegoHastening React SSR - Web Performance San Diego
Hastening React SSR - Web Performance San Diego
 
Introducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverIntroducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and server
 
當ZK遇見Front-End
當ZK遇見Front-End當ZK遇見Front-End
當ZK遇見Front-End
 
Java server faces
Java server facesJava server faces
Java server faces
 
Angular Project Report
 Angular Project Report Angular Project Report
Angular Project Report
 
Angular js
Angular jsAngular js
Angular js
 
Introduction to jsf 2
Introduction to jsf 2Introduction to jsf 2
Introduction to jsf 2
 
Spring MVC 3.0 Framework (sesson_2)
Spring MVC 3.0 Framework (sesson_2)Spring MVC 3.0 Framework (sesson_2)
Spring MVC 3.0 Framework (sesson_2)
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started
 
Introduction of angular js
Introduction of angular jsIntroduction of angular js
Introduction of angular js
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular js
 
Jsf Framework
Jsf FrameworkJsf Framework
Jsf Framework
 
Angular Js Basics
Angular Js BasicsAngular Js Basics
Angular Js Basics
 

Andere mochten auch

Andere mochten auch (13)

Mii gran familiaa!!
Mii gran familiaa!!Mii gran familiaa!!
Mii gran familiaa!!
 
QA-QCREKirkland2015
QA-QCREKirkland2015QA-QCREKirkland2015
QA-QCREKirkland2015
 
history of internet by samandeep
history of internet by samandeephistory of internet by samandeep
history of internet by samandeep
 
Happy new year 2015
Happy new year 2015Happy new year 2015
Happy new year 2015
 
Threat in CPF-247
Threat in CPF-247Threat in CPF-247
Threat in CPF-247
 
Loving suggestions
Loving suggestions Loving suggestions
Loving suggestions
 
Internet
InternetInternet
Internet
 
Loving suggestions
Loving suggestionsLoving suggestions
Loving suggestions
 
List Rental 101
List Rental 101List Rental 101
List Rental 101
 
J.p. morgan iraq and mena trade forum monday 24 september presentation
J.p. morgan iraq and mena trade forum monday 24 september presentationJ.p. morgan iraq and mena trade forum monday 24 september presentation
J.p. morgan iraq and mena trade forum monday 24 september presentation
 
Sulap angka
Sulap angkaSulap angka
Sulap angka
 
عشرة دروس من اليابان
عشرة دروس من اليابانعشرة دروس من اليابان
عشرة دروس من اليابان
 
J.P. Morgan Iraq and MENA Trade Forum Tuesday 25 September Presentation
J.P. Morgan Iraq and MENA Trade Forum Tuesday 25 September PresentationJ.P. Morgan Iraq and MENA Trade Forum Tuesday 25 September Presentation
J.P. Morgan Iraq and MENA Trade Forum Tuesday 25 September Presentation
 

Ähnlich wie Create an application with ember

Getting into ember.js
Getting into ember.jsGetting into ember.js
Getting into ember.jsreybango
 
Introduction to Ember.js
Introduction to Ember.jsIntroduction to Ember.js
Introduction to Ember.jsVinoth Kumar
 
From Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) AgainFrom Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) Againjonknapp
 
ASP .NET MVC
ASP .NET MVC ASP .NET MVC
ASP .NET MVC eldorina
 
Overview of atg framework
Overview of atg frameworkOverview of atg framework
Overview of atg frameworkYousuf Roushan
 
Intro to emberjs
Intro to emberjsIntro to emberjs
Intro to emberjsMandy Pao
 
Ajax toolkit framework
Ajax toolkit frameworkAjax toolkit framework
Ajax toolkit frameworkSunil Kumar
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
 
Javascript Frameworks for Well Architected, Immersive Web Apps
Javascript Frameworks for Well Architected, Immersive Web AppsJavascript Frameworks for Well Architected, Immersive Web Apps
Javascript Frameworks for Well Architected, Immersive Web Appsdnelson-cs
 

Ähnlich wie Create an application with ember (20)

Getting into ember.js
Getting into ember.jsGetting into ember.js
Getting into ember.js
 
MVC
MVCMVC
MVC
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Introduction to Ember.js
Introduction to Ember.jsIntroduction to Ember.js
Introduction to Ember.js
 
Spring Framework-II
Spring Framework-IISpring Framework-II
Spring Framework-II
 
From Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) AgainFrom Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) Again
 
Angular js
Angular jsAngular js
Angular js
 
AngularJS By Vipin
AngularJS By VipinAngularJS By Vipin
AngularJS By Vipin
 
RequireJS
RequireJSRequireJS
RequireJS
 
ASP .NET MVC
ASP .NET MVC ASP .NET MVC
ASP .NET MVC
 
Overview of atg framework
Overview of atg frameworkOverview of atg framework
Overview of atg framework
 
Intro to emberjs
Intro to emberjsIntro to emberjs
Intro to emberjs
 
Angular js
Angular jsAngular js
Angular js
 
Ajax toolkit framework
Ajax toolkit frameworkAjax toolkit framework
Ajax toolkit framework
 
GHC
GHCGHC
GHC
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Handlebars & Require JS
Handlebars  & Require JSHandlebars  & Require JS
Handlebars & Require JS
 
Jinal desai .net
Jinal desai .netJinal desai .net
Jinal desai .net
 
Javascript Frameworks for Well Architected, Immersive Web Apps
Javascript Frameworks for Well Architected, Immersive Web AppsJavascript Frameworks for Well Architected, Immersive Web Apps
Javascript Frameworks for Well Architected, Immersive Web Apps
 
Asp.Net MVC Intro
Asp.Net MVC IntroAsp.Net MVC Intro
Asp.Net MVC Intro
 

Kürzlich hochgeladen

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 

Kürzlich hochgeladen (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

Create an application with ember

  • 1. Ember Build an ambitious application By : Chandrasekar.G
  • 2. What is Ember ? Ember is an open source javascript framework. Collection of libraries that are written in pure MVC architectural pattern.
  • 3. Why Ember ? Avoid boilerplate codes . Creates a standard application architecture . Designed and developed to create and manage large web applications. Dynamic data bindings. Ember follows pure MVC Architectural pattern that
 Improves application testability .
 Keeps application codes modular.
  • 4. Previous development In a Software Application , User interface get change often more than logics and data. Application might be have several parts / state ,So each state of application may have different layout , data displaying styles. So each time user navigate these things are get shuffle when application state change. In the previous programming development business logics and presentation logics are tightly coupled in the codes of JSP and JS files . Disadvantages
  • 5. New development In the new development data logics , business logics and presentation logics are get separated with modular programming pattern. One the main benefit of the decoupling is application will have ability to develop an independent presentation application .
  • 6. Architectural pattern Architectural pattern is a solution to solve design problem . Architectural pattern which gives the clear pictures about application system. It describes the subsystems and components of the application and relation between them. In software world which used to address different kind of issues such as :-
 Performance 
 Security
  • 7. Architectural patterns Model - View - Controller Model - View - Adapter Model - View - View Model Some list of architectural patterns which used in software applications.
  • 8. MVC Overview Model
 The model component covers the list application parts :-
 Data.
 Set of rules to store data in structure. 
 Logics and functions. View
 View component represents the model in different types such as 
 Chart 
 Pivot 
 User customised view Controller
 The Controller component behaves like a mediator which sends the commands to 
 View and Model. MVC software design pattern has divided as three components Model, View Controller.
  • 9. MVC Good Explanation This explanation found on stackoverflow.com. View : "Hey, controller, the user just told me he wants item 4 deleted." Controller : "Hmm, having checked his credentials, he is allowed to do that... 
 Hey, model, I want you to get item 4 and do whatever you do to delete it." Model : "Item 4... got it. It's deleted. Back to you, Controller." Controller : "Here, I'll collect the new set of data. Back to you, view." View : "Cool, I'll show the new set to the user now."
 
 
 By : Andres Jaan Tack
  • 10. Software design layer Book for special offer Name Contact Address Submit Cancel ViewModel Controller Reset Form Update Form Cancel
  • 11. Starting with Ember Requirements 
 jquery.js
 ember.js
 handlebars.js
 ember-data.js
  • 12. Understanding Ember Template
 In Ember, Template concept is used to define user interface of the application Router
 Router is an Ember class which manages the application state . View / Components 
 View class is responsible for data binding with support of templates.
 One more option which provides that developer can implement DOM events for the user interactions . Model
 Model is a class that defines properties , structure and behaviour of the data. Controller
 Ember controllers usually consist the code to execute the tasks. Core concept of Ember
  • 13. Template Template is basically a rear surface of model or presentation. One of the advantage of using template library is when the model get change template also get change automatically. Template engines are written in UI data binding software design pattern. Ember supports handlebars template engine by default , though which provides flexibility to use other templates engine such emblem and etc… . Dynamic UI data binding Some example Client side template engines 
 Emblem
 Underscore JS template 
 Mustache JS
 EJS
 Dust JS

  • 14. Handlebars Handlebars JS takes the given HTML string and It’s own language syntax codes and compiles them to the javascript method. Handlebars JS is an extension of Mustache JS template engine and developed to supersede mustache JS. Logic-less template engine.
  • 15. Using handlebars JS Defining simple handlebar template <script id=“template” type=“text/x-handlebars”> Welcome, <b> {{user.name}} </b> </script > “ {{ }} ” expression represents template 
 model data as HTML Example : Simple handlebar template <script> var context = { user : { name : "Jack Sparrow"} } var templatecontent = $("#template").html();
 var template = Handlebars.compile(templatecontent); $('body').append(template(context)); </script> Getting template by ID Compiler makes template function Passing the data as parameter in the template function
  • 16. Handlebars Helpers Block Helpers
 Handlebars JS provide predefined block level expressions such as conditional
 statements and loops. Custom Helper
 Handlebars JS allows developer to create their own helper with option of resister helper Actions Helpers
 Handlebars actions helpers are mainly implemented to handle DOM events. 
 Actions related codes will be maintain in the controllers. View Helper
 View helper is used to define template with help of view class .. will be cover on ember view Template Helpers
 There are three expression “ template “, “ partial ” and “render” which are used to includes 
 specific template in the context . Outlet
 Outlet helper tells to render the route related template and allows to render child templates. Handlebars JS has some expressions for dynamic data binding
  • 17. Using Block helpers
 <div class={{#if alreadyVisited}} "alreadyVisited"{{/if}} "notVisited"> {{name}} </div> Example : Conditional statements Conditional statements If, else, unless Each {{#each bookmarks}} ! {{/each}} <div class="visitedUsers"> <br> <b> Visited user</b> : {{#unless visitedUser.length}} No one visited yet this site {{else}} {{visitedUser}} {{/unless}} </div> Note : Else if conditions are not supported Example : Each in Handlebar
  • 18. with with is a block helper which helps to change the context of the template . Example : "with" Block helper {{#with otherActivities}} {{sports}} <br> {{music}} {{/with}} Custom Helpers Handlebars.registerHelper("createController", function (string){ return string+"Controller = Em.Controller.extend({})"; }); Example : Custom Block helper Following below codes will create a new helper called creteController 
 so developer can use In that template
  • 19. Ember Application var App = Em.Application.create(); Creating Application Following code will create the instance of ember application. Application provides some default package of components. ! We can implement application view with the help of handlebar like following code ! <script type=“text/x-handlebars” > HTML code goes here </script> ! If we don’t mention any ID in It will render the application view . Basically It makes the body element as ember application .Instead of body element We can specify the Application view element with option of rootElement. var App = Em.Application.create({ rootElement : “main” });
  • 20. Debug configuration LOG_STACKTRACE_ON_DEPRECATION : true, LOG_BINDINGS : true, LOG_TRANSITIONS : true, LOG_TRANSITIONS_INTERNAL : true, LOG_VIEW_LOOKUPS : true, LOG_ACTIVE_GENERATION : true {{debugger}} Following code will throw the error in template Get logs of specified layer {{log controller}} List of properties are available for logging
  • 21. Router Ember router class store the application state in browser’s URL. Ember creates router object on application loads named App.Router. Routes classes are generates with ember UpperCamelCase convention. Application router comes by default with the set of route objects called IndexRoute and ApplicationRoute. ApplicationRoute will load in the all resource by default.
  • 22. Router in Action App.Router.map(function(){}); App.Router loads IndexRouter and ApplicationRoute We can create routes with the option of “resource” and “route”. 
 We can override IndexRouter and ApplicationRouter to make more functionality to the application.
 App.IndexRoute = Em.Route.extend({ init : function() { console.log("Index Route loading "); } }); App.ApplicationRoute = Em.Route.extend({ init : function() { console.log("Application Route loading "); } });
  • 23. Defining Route App.Router.map(function(){ this.resource("users"); this.resource(“user",{path:"users/:id"}); }); This code will create users route This code will create dynamic segments Example : Route and Dynamic route So the generated routes are would be UsersRoute, UserRoute , So the application states are would be access through the URL 
 
 1. http://app/users/ 2. http://app/users/ 1
  • 25. View On Application load ember creates Application view and parallel application template by default.
 Creating View App.CustomView = Em.View.extend({ classNames: [‘customView'] tagName : “span” click : function (){ } }); This code will create View class instance {{#view App.CustomView}} Custom View {{/view}} Rendering template view helper Example : Defining view
  • 26. Ember Application view lifecycle Application Views Container Ember -Handlebar Handlebar compiler Metamorph <script > handlebars Renders HTML
  • 27. Model Defining Ember model App.Info = DS.Model.extend({}); This code will create the model instance Defining attributes App.Info = DS.Model.extend({
 name : DS.attr('string'), version : DS.attr('number'), author : DS.attr('string'),
 hasReleased : DS.attr(‘boolean’ , {defaultValue: false})
 }); Defining data key and It’s type Setting default Example : Example model
  • 28. Controller Ember JS controllers provides developer to write and present data with display logics . Defining action using controller 28 App.PipeController = Em.Controller.extend({ title : "Manage your pipes", actions : { pipeNow : function (){ console.log("You can pipe now ",this.get('pipeNow')); } }, }); Here the logic codes go Example : Example of Controller action