SlideShare ist ein Scribd-Unternehmen logo
1 von 15
AnuradhaMalalasena
What is ?
 JS library aimed to manage data in rich client applications
- It’s client side LINQ to SQL
- Mirror server-side model to client side dynamically (eg :- Entity Framework Objects)
- No need of creating client side Models for every server side entity.
 Implements the Open Data Protocol (OData) query standard
- If a query can be expressed in OData syntax, it can be expressed in Breeze
- http://www.example.com/api/Northwind/Customers?$filter=startswith(CompanyName,'C') eq true&$orderby=CompanyName
 Ships with adapters for the ASP.NET WebAPI for Odata
Communication
DAL
UI
BL (MV*)
Offline Storage
Entities
Module Module Module
Server
Why ?
 It’s free
 Simplify data query tasks (LINQ style)
 Manage client side data caching
 Support batch operations (saveChanges())
 Support all modern browsers on desktop and mobile devices (ECMAScript 5)
 Out-of-box support for Knockout, Angular, and Backbone
 Well documented
 Intellisense support
Key features of
 Query like LINQ
/* Query like LINQ */
// Define query for customers
// starting with 'A', sorted by name,
var query = breeze.EntityQuery
.from("Customers")
.where("CompanyName", "startsWith", "A")
.orderBy("CompanyName");
//... execute it later ...
Key features of
 Query like LINQ
 Async with Promises /* Async query with promises */
// Execute query asynchronously on remote server
// returns a promise ... with success/fail callbacks
var promise = manager.executeQuery(query)
.then(querySucceeded)
.fail(queryFailed);
/* Async save with promises */
// Batch asynchronous save of all entities w/ pending
changes
// returns a promise ... with success/fail callbacks
var promise = manager.saveChanges()
.then(saveSucceeded)
.fail(saveFailed);
Key features of
 Query like LINQ
 Async with Promises
 Change tracking
/* Change tracking */
// save all changes (if there are any)
if (manager.hasChanges()) {
manager.saveChanges()
.then(saveSucceeded)
.fail(saveFailed);
}
// listen for any change to a customer
customer.entityAspect.propertyChanged
.subscribe(somethingHappened);
// listen for validation errors
customer.entityAspect.validationErrorsChanged
.subscribe(updateValidationUI);
Key features of
 Query like LINQ
 Async with Promises
 Change tracking
 Knockout/Angular data binding
<!-- Knockout template -->
<ul data-bind="foreach: results">
<li>
<span data-bind="text:FirstName"></span>
<span data-bind="text:LastName"></span>
</li>
</ul>
// bound to employees from query
manager.executeQuery(breeze.EntityQuery
.from("Employees"))
.then(function(data){
ko.applyBindings(data);
});
Key features of
 Query like LINQ
 Async with Promises
 Change tracking
 Knockout/Angular data binding
 Query with related entities
/* Query with related entities using expand */
// query for orders of customers whose name begins
"Alfreds"
// include their customers & child details & their
detail products
breeze.EntityQuery.from("Orders")
.where("Customer.CompanyName", "startsWith", "Alfre
ds")
.expand("Customer, OrderDetails.Product")
.using(manager)
.execute().then(querySucceeded).fail(queryFailed);
Key features of
 Query like LINQ
 Async with Promises
 Change tracking
 Knockout/Angular data binding
 Query with related entities
 Navigate to related entities
/* Navigate to related entities in cache */
// Query success callback
function querySucceeded (data) {
var order1 = data.results[0];
// Parent customer of the order
var customer = order1.Customer();
// Product of the first OrderDetail of the order
var product1 = order1.OrderDetails()[0].Product();
}
Key features of
 Query like LINQ
 Async with Promises
 Change tracking
 Knockout/Angular data binding
 Query with related entities
 Navigate to related entities
 Flatten entity graphs
/* Flatten entity graphs */
// Projection query: "select" flattens the Orders to 4
fields.
// Order id, ship date, & customer name of Orders w/
freight > $500
breeze.EntityQuery.from("Orders")
.where("Freight", ">", 500)
.select("OrderId, Customer.CompanyName,
ShippedDate")
.orderBy("Customer.CompanyName, ShippedDate");
Key features of
 Query like LINQ
 Async with Promises
 Change tracking
 Knockout/Angular data binding
 Query with related entities
 Navigate to related entities
 Flatten entity graphs
 Query server or cache
/* Query the server, cache, or both */
var query = breeze.EntityQuery("Customers");
// execute query asynchronously on the server
manager.executeQuery(query).then(querySuccess).fail(qu
eryFail);
// execute query synchronously on local cache
var customers = manager.executeQueryLocally(query)
// fetch customer by id from cache (if found) or
remotely
var checkCacheFirst = true;
manager.fetchEntityByKey("CompanyName", 42,
checkCacheFirst)
.then(fetchSuccess).fail(fetchFail);
Key features of
 Query like LINQ
 Async with Promises
 Change tracking
 Knockout/Angular data binding
 Query with related entities
 Navigate to related entities
 Flatten entity graphs
 Query server or cache
 Save changes offline
/* Save changes offline; restore later */
var changes = manager.getChanges();
var exportData = manager.exportEntities(changes);
window.localStorage.setItem("changes", exportData);
// ... later ...
var importData =
window.localStorage.getItem("changes");
manager.importEntities(importData);
Demo
ThankYOU

Weitere ähnliche Inhalte

Was ist angesagt?

SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...Sencha
 
Building better SQL Server Databases
Building better SQL Server DatabasesBuilding better SQL Server Databases
Building better SQL Server DatabasesColdFusionConference
 
Going Serverless with Azure Functions in .NET
Going Serverless with Azure Functions in .NETGoing Serverless with Azure Functions in .NET
Going Serverless with Azure Functions in .NETJeremy Likness
 
Galen Framework - Responsive Design Automation
Galen Framework - Responsive Design AutomationGalen Framework - Responsive Design Automation
Galen Framework - Responsive Design AutomationVenkat Ramana Reddy Parine
 
Spicing up SharePoint web parts
Spicing up SharePoint web partsSpicing up SharePoint web parts
Spicing up SharePoint web partsRandy Williams
 
Code First with Serverless Azure Functions
Code First with Serverless Azure FunctionsCode First with Serverless Azure Functions
Code First with Serverless Azure FunctionsJeremy Likness
 
ADO.NET Data Services
ADO.NET Data ServicesADO.NET Data Services
ADO.NET Data Servicesukdpe
 
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...SharePoint Saturday NY
 
Deploying your static web app to the Cloud
Deploying your static web app to the CloudDeploying your static web app to the Cloud
Deploying your static web app to the CloudChristoffer Noring
 
MVC 6 - Tag Helpers and View Components
MVC 6 - Tag Helpers and View ComponentsMVC 6 - Tag Helpers and View Components
MVC 6 - Tag Helpers and View ComponentsDavid Paquette
 
Customizations in Enterprise Applications using Oracle ADF
Customizations in Enterprise Applications using Oracle ADFCustomizations in Enterprise Applications using Oracle ADF
Customizations in Enterprise Applications using Oracle ADFRohan Walia
 
Tokyo Azure Meetup #14 - Azure Functions Proxies
Tokyo Azure Meetup #14  -  Azure Functions ProxiesTokyo Azure Meetup #14  -  Azure Functions Proxies
Tokyo Azure Meetup #14 - Azure Functions ProxiesTokyo Azure Meetup
 
MSDN Sessions 032817 - Azure Functions
MSDN Sessions 032817 - Azure FunctionsMSDN Sessions 032817 - Azure Functions
MSDN Sessions 032817 - Azure FunctionsMarc Obaldo
 
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solution
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solutionDotnet- An overview of ASP.NET & ADO.NET- Mazenet solution
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solutionMazenetsolution
 
oracle oa framework training | oracle oa framework training courses | oa fram...
oracle oa framework training | oracle oa framework training courses | oa fram...oracle oa framework training | oracle oa framework training courses | oa fram...
oracle oa framework training | oracle oa framework training courses | oa fram...Nancy Thomas
 
Building Your Own Development Tools With the Force.com Tooling API
Building Your Own Development Tools With the Force.com Tooling APIBuilding Your Own Development Tools With the Force.com Tooling API
Building Your Own Development Tools With the Force.com Tooling APISalesforce Developers
 

Was ist angesagt? (20)

SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
 
Building better SQL Server Databases
Building better SQL Server DatabasesBuilding better SQL Server Databases
Building better SQL Server Databases
 
Going Serverless with Azure Functions in .NET
Going Serverless with Azure Functions in .NETGoing Serverless with Azure Functions in .NET
Going Serverless with Azure Functions in .NET
 
Galen Framework - Responsive Design Automation
Galen Framework - Responsive Design AutomationGalen Framework - Responsive Design Automation
Galen Framework - Responsive Design Automation
 
Spicing up SharePoint web parts
Spicing up SharePoint web partsSpicing up SharePoint web parts
Spicing up SharePoint web parts
 
Oracle ADF Case Study
Oracle ADF Case StudyOracle ADF Case Study
Oracle ADF Case Study
 
RESTful API - Best Practices
RESTful API - Best PracticesRESTful API - Best Practices
RESTful API - Best Practices
 
Code First with Serverless Azure Functions
Code First with Serverless Azure FunctionsCode First with Serverless Azure Functions
Code First with Serverless Azure Functions
 
Angularjs & REST
Angularjs & RESTAngularjs & REST
Angularjs & REST
 
ADO.NET Data Services
ADO.NET Data ServicesADO.NET Data Services
ADO.NET Data Services
 
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
 
Deploying your static web app to the Cloud
Deploying your static web app to the CloudDeploying your static web app to the Cloud
Deploying your static web app to the Cloud
 
MVC 6 - Tag Helpers and View Components
MVC 6 - Tag Helpers and View ComponentsMVC 6 - Tag Helpers and View Components
MVC 6 - Tag Helpers and View Components
 
Customizations in Enterprise Applications using Oracle ADF
Customizations in Enterprise Applications using Oracle ADFCustomizations in Enterprise Applications using Oracle ADF
Customizations in Enterprise Applications using Oracle ADF
 
Tokyo Azure Meetup #14 - Azure Functions Proxies
Tokyo Azure Meetup #14  -  Azure Functions ProxiesTokyo Azure Meetup #14  -  Azure Functions Proxies
Tokyo Azure Meetup #14 - Azure Functions Proxies
 
MSDN Sessions 032817 - Azure Functions
MSDN Sessions 032817 - Azure FunctionsMSDN Sessions 032817 - Azure Functions
MSDN Sessions 032817 - Azure Functions
 
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solution
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solutionDotnet- An overview of ASP.NET & ADO.NET- Mazenet solution
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solution
 
oracle oa framework training | oracle oa framework training courses | oa fram...
oracle oa framework training | oracle oa framework training courses | oa fram...oracle oa framework training | oracle oa framework training courses | oa fram...
oracle oa framework training | oracle oa framework training courses | oa fram...
 
Oracle application framework (oaf) online training
Oracle application framework (oaf) online trainingOracle application framework (oaf) online training
Oracle application framework (oaf) online training
 
Building Your Own Development Tools With the Force.com Tooling API
Building Your Own Development Tools With the Force.com Tooling APIBuilding Your Own Development Tools With the Force.com Tooling API
Building Your Own Development Tools With the Force.com Tooling API
 

Ähnlich wie Introduction to BreezeJs

SharePoint Client Object Model (CSOM)
SharePoint Client Object Model (CSOM)SharePoint Client Object Model (CSOM)
SharePoint Client Object Model (CSOM)Kashif Imran
 
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...MSDEVMTL
 
SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4Jon Galloway
 
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBuilding workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBizTalk360
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJSWei Ru
 
Windows Azure and a little SQL Data Services
Windows Azure and a little SQL Data ServicesWindows Azure and a little SQL Data Services
Windows Azure and a little SQL Data Servicesukdpe
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NETPeter Gfader
 
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EEJavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EERodrigo Cândido da Silva
 
Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010Ben Robb
 
Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Paco de la Cruz
 
Microservice Websites – Micro CPH
Microservice Websites – Micro CPHMicroservice Websites – Micro CPH
Microservice Websites – Micro CPHGustaf Nilsson Kotte
 
Wcf data services
Wcf data servicesWcf data services
Wcf data servicesEyal Vardi
 
Intoduction to Play Framework
Intoduction to Play FrameworkIntoduction to Play Framework
Intoduction to Play FrameworkKnoldus Inc.
 
Couchbase@live person meetup july 22nd
Couchbase@live person meetup   july 22ndCouchbase@live person meetup   july 22nd
Couchbase@live person meetup july 22ndIdo Shilon
 
[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습
[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습
[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습Oracle Korea
 
CQRS and Event Sourcing
CQRS and Event Sourcing CQRS and Event Sourcing
CQRS and Event Sourcing Inho Kang
 

Ähnlich wie Introduction to BreezeJs (20)

SharePoint Client Object Model (CSOM)
SharePoint Client Object Model (CSOM)SharePoint Client Object Model (CSOM)
SharePoint Client Object Model (CSOM)
 
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
 
SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4
 
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBuilding workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
 
Jsf presentation
Jsf presentationJsf presentation
Jsf presentation
 
ASP.NET Lecture 2
ASP.NET Lecture 2ASP.NET Lecture 2
ASP.NET Lecture 2
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS
 
App fabric introduction
App fabric introductionApp fabric introduction
App fabric introduction
 
Windows Azure and a little SQL Data Services
Windows Azure and a little SQL Data ServicesWindows Azure and a little SQL Data Services
Windows Azure and a little SQL Data Services
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EEJavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
 
Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010
 
Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)
 
Microservice Websites – Micro CPH
Microservice Websites – Micro CPHMicroservice Websites – Micro CPH
Microservice Websites – Micro CPH
 
Wcf data services
Wcf data servicesWcf data services
Wcf data services
 
Intoduction to Play Framework
Intoduction to Play FrameworkIntoduction to Play Framework
Intoduction to Play Framework
 
State management
State managementState management
State management
 
Couchbase@live person meetup july 22nd
Couchbase@live person meetup   july 22ndCouchbase@live person meetup   july 22nd
Couchbase@live person meetup july 22nd
 
[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습
[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습
[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습
 
CQRS and Event Sourcing
CQRS and Event Sourcing CQRS and Event Sourcing
CQRS and Event Sourcing
 

Kürzlich hochgeladen

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

Introduction to BreezeJs

  • 2. What is ?  JS library aimed to manage data in rich client applications - It’s client side LINQ to SQL - Mirror server-side model to client side dynamically (eg :- Entity Framework Objects) - No need of creating client side Models for every server side entity.  Implements the Open Data Protocol (OData) query standard - If a query can be expressed in OData syntax, it can be expressed in Breeze - http://www.example.com/api/Northwind/Customers?$filter=startswith(CompanyName,'C') eq true&$orderby=CompanyName  Ships with adapters for the ASP.NET WebAPI for Odata
  • 4. Why ?  It’s free  Simplify data query tasks (LINQ style)  Manage client side data caching  Support batch operations (saveChanges())  Support all modern browsers on desktop and mobile devices (ECMAScript 5)  Out-of-box support for Knockout, Angular, and Backbone  Well documented  Intellisense support
  • 5. Key features of  Query like LINQ /* Query like LINQ */ // Define query for customers // starting with 'A', sorted by name, var query = breeze.EntityQuery .from("Customers") .where("CompanyName", "startsWith", "A") .orderBy("CompanyName"); //... execute it later ...
  • 6. Key features of  Query like LINQ  Async with Promises /* Async query with promises */ // Execute query asynchronously on remote server // returns a promise ... with success/fail callbacks var promise = manager.executeQuery(query) .then(querySucceeded) .fail(queryFailed); /* Async save with promises */ // Batch asynchronous save of all entities w/ pending changes // returns a promise ... with success/fail callbacks var promise = manager.saveChanges() .then(saveSucceeded) .fail(saveFailed);
  • 7. Key features of  Query like LINQ  Async with Promises  Change tracking /* Change tracking */ // save all changes (if there are any) if (manager.hasChanges()) { manager.saveChanges() .then(saveSucceeded) .fail(saveFailed); } // listen for any change to a customer customer.entityAspect.propertyChanged .subscribe(somethingHappened); // listen for validation errors customer.entityAspect.validationErrorsChanged .subscribe(updateValidationUI);
  • 8. Key features of  Query like LINQ  Async with Promises  Change tracking  Knockout/Angular data binding <!-- Knockout template --> <ul data-bind="foreach: results"> <li> <span data-bind="text:FirstName"></span> <span data-bind="text:LastName"></span> </li> </ul> // bound to employees from query manager.executeQuery(breeze.EntityQuery .from("Employees")) .then(function(data){ ko.applyBindings(data); });
  • 9. Key features of  Query like LINQ  Async with Promises  Change tracking  Knockout/Angular data binding  Query with related entities /* Query with related entities using expand */ // query for orders of customers whose name begins "Alfreds" // include their customers & child details & their detail products breeze.EntityQuery.from("Orders") .where("Customer.CompanyName", "startsWith", "Alfre ds") .expand("Customer, OrderDetails.Product") .using(manager) .execute().then(querySucceeded).fail(queryFailed);
  • 10. Key features of  Query like LINQ  Async with Promises  Change tracking  Knockout/Angular data binding  Query with related entities  Navigate to related entities /* Navigate to related entities in cache */ // Query success callback function querySucceeded (data) { var order1 = data.results[0]; // Parent customer of the order var customer = order1.Customer(); // Product of the first OrderDetail of the order var product1 = order1.OrderDetails()[0].Product(); }
  • 11. Key features of  Query like LINQ  Async with Promises  Change tracking  Knockout/Angular data binding  Query with related entities  Navigate to related entities  Flatten entity graphs /* Flatten entity graphs */ // Projection query: "select" flattens the Orders to 4 fields. // Order id, ship date, & customer name of Orders w/ freight > $500 breeze.EntityQuery.from("Orders") .where("Freight", ">", 500) .select("OrderId, Customer.CompanyName, ShippedDate") .orderBy("Customer.CompanyName, ShippedDate");
  • 12. Key features of  Query like LINQ  Async with Promises  Change tracking  Knockout/Angular data binding  Query with related entities  Navigate to related entities  Flatten entity graphs  Query server or cache /* Query the server, cache, or both */ var query = breeze.EntityQuery("Customers"); // execute query asynchronously on the server manager.executeQuery(query).then(querySuccess).fail(qu eryFail); // execute query synchronously on local cache var customers = manager.executeQueryLocally(query) // fetch customer by id from cache (if found) or remotely var checkCacheFirst = true; manager.fetchEntityByKey("CompanyName", 42, checkCacheFirst) .then(fetchSuccess).fail(fetchFail);
  • 13. Key features of  Query like LINQ  Async with Promises  Change tracking  Knockout/Angular data binding  Query with related entities  Navigate to related entities  Flatten entity graphs  Query server or cache  Save changes offline /* Save changes offline; restore later */ var changes = manager.getChanges(); var exportData = manager.exportEntities(changes); window.localStorage.setItem("changes", exportData); // ... later ... var importData = window.localStorage.getItem("changes"); manager.importEntities(importData);
  • 14. Demo