SlideShare ist ein Scribd-Unternehmen logo
1 von 32
THE SOFTWARE EXPERTS 
Reactive UIs with the 
Model View ViewModel Pattern: 
Simple with Ankor.io 
Thomas Spiegl 
Manfred Geiler 
Irian Solutions - The Software Experts
THE SOFTWARE EXPERTS 
Agenda 
• M V V M 
• New concept „MVSVM“ 
• Ankor framework 
• Ankor live sample 
• Ankor special features
THE SOFTWARE EXPERTS 
„M V V M” ? 
• „Model View ViewModel“ 
• 2005 by John Gossman (Microsoft) 
• ≅ „Presentation Model“ by Martin Fowler 
• Separation of Concerns 
o Graphical UI 
o UI logic
THE SOFTWARE EXPERTS 
Model View Controller 
View 
Model 
Controller
THE SOFTWARE EXPERTS 
Model View ViewModel 
Business Logic and Data 
Presentation & UI Logic 
View 
DB 
Binding 
ViewModel 
Domain 
Model 
Service Calls
THE SOFTWARE EXPERTS 
M V V M – The View 
• Graphical user interface (GUI) 
• User inputs 
• Data binding to the ViewModel 
• Markup 
o XAML 
o FXML 
Business Logic and Data 
Presentation & UI Logic 
DB 
Data Binding 
ViewModel 
Service Calls 
Model 
View
THE SOFTWARE EXPERTS 
M V V M – The ViewModel 
• Link between View and Model 
• Connection to Model (service calls) 
• Properties and actions for the View (binding) 
• UI logic 
• UI validation 
Business Logic and Data 
Presentation & UI Logic 
View 
DB 
Data Binding 
Service Calls 
Model 
ViewModel
THE SOFTWARE EXPERTS 
M V V M – The Model 
• Domain model 
• Data(base) access 
• Domain logic 
• Business Rules 
Presentation & UI Logic 
• Validation 
View 
• Unit testing Business Logic and Data 
DB 
Data Binding 
ViewModel 
Service Calls 
Model
THE SOFTWARE EXPERTS 
MVVM solves... 
• Separation of concerns 
o Web designer ↔ UI developer 
o View technology ↔ Presentation logic 
• Testable ViewModel! 
o Unit tests 
o Mock View 
Business Logic and Data 
Presentation & UI Logic 
View 
DB 
Data Binding 
ViewModel 
Service Calls 
Model
THE SOFTWARE EXPERTS 
MVVM does not solve... 
• Model on client or server? 
• Communication client ↔ server 
• Various client technologies 
o HTML5 
o iOS 
o Android 
o JavaFX 
Presentation & UI Logic 
View 
ViewModel 
o ... Business Logic and Data 
DB 
Data Binding 
Service Calls 
Model
THE SOFTWARE EXPERTS 
Agenda 
• M V V M 
• New concept „MVSVM“ 
• Ankor framework 
• Ankor live sample 
• Ankor special features
THE SOFTWARE EXPERTS 
Client 
Server 
Model View SynchronizedViewModel 
View 
ViewModel ViewModel 
DB 
Model 
Data Binding 
Synchronization
THE SOFTWARE EXPERTS 
MVSVM - Synchronized ViewModel 
Client 
Server 
View 
ViewModel ViewModel 
DB 
Model 
Data Binding 
Synchronization 
Client holds: 
• View 
• ViewModel 
Client technology: 
• Modern platform 
o HTML5 
o JavaFX 
o iOS, Android 
o ... 
• Very latest frameworks 
• Cutting edge 
Server holds: 
• ViewModel 
• Model 
Server technology: 
• Java EE 
• Approved patterns 
• Stable platform
THE SOFTWARE EXPERTS 
Agenda 
• M V V M 
• New concept „MVSVM“ 
• Ankor framework 
• Ankor live sample 
• Ankor special features
THE SOFTWARE EXPERTS 
Project „Ankor” 
• 2013 
• http://www.ankor.io 
• Open Source (Apache License, Version 2.0) 
• Expandable modular framework 
o Event driven programming model 
o Asynchronous processing 
o Bidirectional client-server communication 
o Native MVSVM support
THE SOFTWARE EXPERTS 
Ankor Server 
Client 
Ankor - Synchronized ViewModel 
View 
ViewModel 
● Strongly typed 
● Behaviour 
DB 
Data Binding 
Change Events 
Action Events 
ViewModel 
● Type-less 
● Only data 
Model
THE SOFTWARE EXPERTS 
JEE Server 
Client 
Ankor - Synchronized ViewModel 
View 
ViewModel 
● Strongly typed 
● Behaviour 
DB 
Data Binding 
Change Events 
Action Events 
ViewModel 
● Type-less 
● Only data 
Model 
ViewModel (client side) 
● Type-less 
● Only data 
{ 
"tasks": [ 
{"id": "dda6f7d9-8d5e-4baf-969b-110f654a64e3", 
"title": "drink less coffee", 
"completed": false}, 
{"id": "ff202f81-33b8-4ae3-bf6a-0208714e2261", 
"title": "get more sleep", 
"completed": false} 
], 
"filter": "all", 
"itemsLeft": 2 
} 
ViewModel (server side) 
● Strongly typed 
● Behaviour 
public class TaskListViewModel { 
private List<Task> tasks; 
private String filter; 
private Integer itemsLeft; 
// getters and setters 
} 
public class Task { 
private String id; 
private String title; 
private boolean completed; 
// getters and setters 
}
THE SOFTWARE EXPERTS 
JavaFX HTML5 iOS .NET 
Messaging (Connector HTTP, Websocket, JMS, ...) 
Ankor Framework 
JEE Server 
DB 
Ankor – Architecture overview 
View 
ViewModel 
Model
THE SOFTWARE EXPERTS 
Ankor – Client Architecture 
• Various client languages und platforms 
o Java 
 JavaFX 
 Android 
o Javascript / HTML5 
 jQuery 
 AngularJS 
 React 
o Objective-C 
 iOS 
o C# 
 .NET / WPF 
JavaFX HTML5 iOS .NET 
Messaging (HTTP, Websocket, JMS, ...) 
Ankor Framework 
JEE Server
THE SOFTWARE EXPERTS 
Ankor – Server Architecture 
• Java SE 1.6 (or higher) 
• Various network protocols 
o Socket 
o HTTP-Polling 
o Websocket 
• Messaging 
o JSON 
• Concurrency / Parallelization 
o Simple Synchronization 
o Akka Actors 
• JEE / Web Container 
JavaFX HTML5 iOS .NET 
Messaging (HTTP, Websocket, JMS, ...) 
Ankor Framework 
o Glassfish (Websocket) 
o Tomcat 
o Spring Boot (Websocket, embedded Tomcat) 
JEE Server
THE SOFTWARE EXPERTS 
Agenda 
• M V V M 
• New concept „MVSVM“ 
• Ankor framework 
• Ankor live sample 
• Ankor special features
THE SOFTWARE EXPERTS 
Ankor - iOS Example
THE SOFTWARE EXPERTS 
Ankor - iOS Example 
Start Ankor System, connect to server 
[[[ANKSystem alloc] 
initWith:@"root" connectParams:connectParams 
url:@"ws://localhost:8080/websocket/ankor" 
useWebsocket:YES] start];
THE SOFTWARE EXPERTS 
Register Change Listener 
[ANKRefs observe:@"root.model.tasks" 
target:self listener:@selector(tasksChanged:)]; 
Change Listener 
- (void)tasksChanged:(id) value { 
[[self toDoItems]removeAllObjects]; 
[[self toDoItems]addObjectsFromArray:value]; 
[self.tableView reloadData]; 
} 
Ankor - iOS Example
THE SOFTWARE EXPERTS 
Ankor - iOS Example 
Fire Action / Add a new Task 
[ANKRefs fireAction:@"root.model" 
name:@"newTask" 
params:params]; // Dictionary 
ActionListener Java 
@ActionListener 
public void newTask(@Param("title") final String title) 
{...}
THE SOFTWARE EXPERTS 
Agenda 
• M V V M 
• New concept „MVSVM“ 
• Ankor framework 
• Ankor live sample 
• Ankor special features
THE SOFTWARE EXPERTS 
Client 
Ankor - Special Features 
Server • Ankor Annotations 
• Ankor Big Collections 
o BigList 
o BigMap 
• Ankor Flood Control 
• Pluggable Bean-Factory 
o Simple/Reflection 
o Spring 
o CDI (planned) 
• Collaboration Support 
• Stateless Server 
Model 
public class AnimalSearchViewModel { 
private AnimalSearchFilter filter; 
@ChangeListener(pattern = {".filter.**"}) 
public void reloadAnimals() { 
this.animals 
= animalRepository.searchAnimals(filter); 
}
THE SOFTWARE EXPERTS 
Server 
public class AnimalSearchViewModel { 
private List<Animal> animals 
= new ArrayList<Animal>(10000); 
@AnkorBigList(chunkSize = 10) 
public List<Animal> getAnimals() { 
return animals; 
} 
send 10 rows at 
once – 
on demand only! 
• Ankor Annotations 
• Ankor Big Collections 
o BigList 
o BigMap 
• Ankor Flood Control 
• Pluggable Bean-Factory 
o Simple/Reflection 
o Spring 
o CDI (planned) 
• Collaboration Support 
• Stateless Server 
Model 
Ankor - Special Features 
Client
THE SOFTWARE EXPERTS 
Ankor - Special Features 
Server • Ankor Annotations 
• Ankor Big Collections 
o BigList 
o BigMap 
• Ankor Flood Control 
• Pluggable Bean-Factory 
o Simple/Reflection 
o Spring 
o CDI (planned) 
• Collaboration Support 
• Stateless Server 
Model 
public class AnimalSearchViewModel { 
@ChangeListener(pattern = {".filter.**"}) 
@AnkorFloodControl(delayMillis = 100L) 
public void reloadAnimals() { 
this.animals 
= animalRepository.searchAnimals(filter); 
} 
Client
THE SOFTWARE EXPERTS 
Server 
Shared ViewModel 
• Ankor Annotations 
• Ankor Big Collections 
o BigList 
o BigMap 
• Ankor Flood Control 
• Pluggable Bean-Factory 
o Simple/Reflection 
o Spring 
o CDI (planned) 
• Collaboration Support 
• Stateless Server 
Model 
Ankor - Special Features
THE SOFTWARE EXPERTS 
Server 
• Ankor Annotations 
• Ankor Big Collections 
o BigList 
o BigMap 
• Ankor Flood Control 
• Pluggable Bean-Factory 
o Simple/Reflection 
o Spring 
o CDI (planned) 
• Collaboration Support 
• Stateless Server 
Model 
Ankor - Special Features 
send state 
information 
public class TaskListModel { 
@StateHolder 
private Filter filter; 
public void setFilter(String filter) { 
this.filter = 
Filter.valueOf(filter); 
initCalculatedFields(); 
}
THE SOFTWARE EXPERTS 
Ankor.io 
Further information, documentation & tutorials 
http://ankor.io 
http://github.com/ankor-io 
Thomas Spiegl 
Manfred Geiler

Weitere ähnliche Inhalte

Was ist angesagt?

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 overviewSergey Seletsky
 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - IntroductionSenthil Kumar
 
Dynamic Application Development by NodeJS ,AngularJS with OrientDB
Dynamic Application Development by NodeJS ,AngularJS with OrientDBDynamic Application Development by NodeJS ,AngularJS with OrientDB
Dynamic Application Development by NodeJS ,AngularJS with OrientDBApaichon Punopas
 
Everything you need to know about HTML5 in 15 min
Everything you need to know about HTML5 in 15 minEverything you need to know about HTML5 in 15 min
Everything you need to know about HTML5 in 15 minEdgar Parada
 
Hanselman lipton asp_connections_ams304_mvc
Hanselman lipton asp_connections_ams304_mvcHanselman lipton asp_connections_ams304_mvc
Hanselman lipton asp_connections_ams304_mvcdenemedeniz
 
[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JS[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JSIvano Malavolta
 
Angular2 and TypeScript
Angular2 and TypeScriptAngular2 and TypeScript
Angular2 and TypeScriptDavid Giard
 
Crash Course in AngularJS + Ionic (Deep dive)
Crash Course in AngularJS + Ionic (Deep dive)Crash Course in AngularJS + Ionic (Deep dive)
Crash Course in AngularJS + Ionic (Deep dive)ColdFusionConference
 
Seven Versions of One Web Application
Seven Versions of One Web ApplicationSeven Versions of One Web Application
Seven Versions of One Web ApplicationYakov Fain
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO DevsWO Community
 
Sitecore MVC: Converting Web Forms sublayouts
Sitecore MVC: Converting Web Forms sublayoutsSitecore MVC: Converting Web Forms sublayouts
Sitecore MVC: Converting Web Forms sublayoutsnonlinear creations
 
Introduction to ASP.Net MVC
Introduction to ASP.Net MVCIntroduction to ASP.Net MVC
Introduction to ASP.Net MVCSagar Kamate
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Thomas Robbins
 
Asp.Net Mvc
Asp.Net MvcAsp.Net Mvc
Asp.Net Mvcmicham
 
MvvmQuickCross for Windows Phone
MvvmQuickCross for Windows PhoneMvvmQuickCross for Windows Phone
MvvmQuickCross for Windows PhoneVincent Hoogendoorn
 

Was ist angesagt? (20)

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
 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - Introduction
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
 
Dynamic Application Development by NodeJS ,AngularJS with OrientDB
Dynamic Application Development by NodeJS ,AngularJS with OrientDBDynamic Application Development by NodeJS ,AngularJS with OrientDB
Dynamic Application Development by NodeJS ,AngularJS with OrientDB
 
Everything you need to know about HTML5 in 15 min
Everything you need to know about HTML5 in 15 minEverything you need to know about HTML5 in 15 min
Everything you need to know about HTML5 in 15 min
 
Hanselman lipton asp_connections_ams304_mvc
Hanselman lipton asp_connections_ams304_mvcHanselman lipton asp_connections_ams304_mvc
Hanselman lipton asp_connections_ams304_mvc
 
[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JS[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JS
 
Angular2 and TypeScript
Angular2 and TypeScriptAngular2 and TypeScript
Angular2 and TypeScript
 
Mule 2.2.1-users-guide
Mule 2.2.1-users-guideMule 2.2.1-users-guide
Mule 2.2.1-users-guide
 
Handlebars & Require JS
Handlebars  & Require JSHandlebars  & Require JS
Handlebars & Require JS
 
[2015/2016] JavaScript
[2015/2016] JavaScript[2015/2016] JavaScript
[2015/2016] JavaScript
 
Crash Course in AngularJS + Ionic (Deep dive)
Crash Course in AngularJS + Ionic (Deep dive)Crash Course in AngularJS + Ionic (Deep dive)
Crash Course in AngularJS + Ionic (Deep dive)
 
Seven Versions of One Web Application
Seven Versions of One Web ApplicationSeven Versions of One Web Application
Seven Versions of One Web Application
 
Introduction to Angular JS
Introduction to Angular JSIntroduction to Angular JS
Introduction to Angular JS
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO Devs
 
Sitecore MVC: Converting Web Forms sublayouts
Sitecore MVC: Converting Web Forms sublayoutsSitecore MVC: Converting Web Forms sublayouts
Sitecore MVC: Converting Web Forms sublayouts
 
Introduction to ASP.Net MVC
Introduction to ASP.Net MVCIntroduction to ASP.Net MVC
Introduction to ASP.Net MVC
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
 
Asp.Net Mvc
Asp.Net MvcAsp.Net Mvc
Asp.Net Mvc
 
MvvmQuickCross for Windows Phone
MvvmQuickCross for Windows PhoneMvvmQuickCross for Windows Phone
MvvmQuickCross for Windows Phone
 

Ähnlich wie Ankor Presentation @ JavaOne San Francisco September 2014

ZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpChalermpon Areepong
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...Malin Weiss
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...Speedment, Inc.
 
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
 
JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)Hendrik Ebbers
 
How to generate customized java 8 code from your database
How to generate customized java 8 code from your databaseHow to generate customized java 8 code from your database
How to generate customized java 8 code from your databaseSpeedment, Inc.
 
Silicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSilicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSpeedment, Inc.
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to conceptsAbhishek Sur
 
Building production websites with Node.js on the Microsoft stack
Building production websites with Node.js on the Microsoft stackBuilding production websites with Node.js on the Microsoft stack
Building production websites with Node.js on the Microsoft stackCellarTracker
 
Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0Mayank Srivastava
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...Mark Leusink
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...Mark Roden
 
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
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?Balajihope
 
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
ZZ BC#7.5 asp.net mvc practice  and guideline refresh! ZZ BC#7.5 asp.net mvc practice  and guideline refresh!
ZZ BC#7.5 asp.net mvc practice and guideline refresh! Chalermpon Areepong
 
Non-Microsoft Technologies Which Microsoft is Embracing
Non-Microsoft Technologies Which Microsoft is EmbracingNon-Microsoft Technologies Which Microsoft is Embracing
Non-Microsoft Technologies Which Microsoft is EmbracingElton Stoneman
 

Ähnlich wie Ankor Presentation @ JavaOne San Francisco September 2014 (20)

ZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
 
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
 
JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)
 
How to generate customized java 8 code from your database
How to generate customized java 8 code from your databaseHow to generate customized java 8 code from your database
How to generate customized java 8 code from your database
 
Silicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSilicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your database
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to concepts
 
Building production websites with Node.js on the Microsoft stack
Building production websites with Node.js on the Microsoft stackBuilding production websites with Node.js on the Microsoft stack
Building production websites with Node.js on the Microsoft stack
 
Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
 
Mean stack
Mean stackMean stack
Mean stack
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
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
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?
 
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
ZZ BC#7.5 asp.net mvc practice  and guideline refresh! ZZ BC#7.5 asp.net mvc practice  and guideline refresh!
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
 
Non-Microsoft Technologies Which Microsoft is Embracing
Non-Microsoft Technologies Which Microsoft is EmbracingNon-Microsoft Technologies Which Microsoft is Embracing
Non-Microsoft Technologies Which Microsoft is Embracing
 
Angular
AngularAngular
Angular
 
Angular
AngularAngular
Angular
 

Kürzlich hochgeladen

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 

Kürzlich hochgeladen (20)

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 

Ankor Presentation @ JavaOne San Francisco September 2014

  • 1. THE SOFTWARE EXPERTS Reactive UIs with the Model View ViewModel Pattern: Simple with Ankor.io Thomas Spiegl Manfred Geiler Irian Solutions - The Software Experts
  • 2. THE SOFTWARE EXPERTS Agenda • M V V M • New concept „MVSVM“ • Ankor framework • Ankor live sample • Ankor special features
  • 3. THE SOFTWARE EXPERTS „M V V M” ? • „Model View ViewModel“ • 2005 by John Gossman (Microsoft) • ≅ „Presentation Model“ by Martin Fowler • Separation of Concerns o Graphical UI o UI logic
  • 4. THE SOFTWARE EXPERTS Model View Controller View Model Controller
  • 5. THE SOFTWARE EXPERTS Model View ViewModel Business Logic and Data Presentation & UI Logic View DB Binding ViewModel Domain Model Service Calls
  • 6. THE SOFTWARE EXPERTS M V V M – The View • Graphical user interface (GUI) • User inputs • Data binding to the ViewModel • Markup o XAML o FXML Business Logic and Data Presentation & UI Logic DB Data Binding ViewModel Service Calls Model View
  • 7. THE SOFTWARE EXPERTS M V V M – The ViewModel • Link between View and Model • Connection to Model (service calls) • Properties and actions for the View (binding) • UI logic • UI validation Business Logic and Data Presentation & UI Logic View DB Data Binding Service Calls Model ViewModel
  • 8. THE SOFTWARE EXPERTS M V V M – The Model • Domain model • Data(base) access • Domain logic • Business Rules Presentation & UI Logic • Validation View • Unit testing Business Logic and Data DB Data Binding ViewModel Service Calls Model
  • 9. THE SOFTWARE EXPERTS MVVM solves... • Separation of concerns o Web designer ↔ UI developer o View technology ↔ Presentation logic • Testable ViewModel! o Unit tests o Mock View Business Logic and Data Presentation & UI Logic View DB Data Binding ViewModel Service Calls Model
  • 10. THE SOFTWARE EXPERTS MVVM does not solve... • Model on client or server? • Communication client ↔ server • Various client technologies o HTML5 o iOS o Android o JavaFX Presentation & UI Logic View ViewModel o ... Business Logic and Data DB Data Binding Service Calls Model
  • 11. THE SOFTWARE EXPERTS Agenda • M V V M • New concept „MVSVM“ • Ankor framework • Ankor live sample • Ankor special features
  • 12. THE SOFTWARE EXPERTS Client Server Model View SynchronizedViewModel View ViewModel ViewModel DB Model Data Binding Synchronization
  • 13. THE SOFTWARE EXPERTS MVSVM - Synchronized ViewModel Client Server View ViewModel ViewModel DB Model Data Binding Synchronization Client holds: • View • ViewModel Client technology: • Modern platform o HTML5 o JavaFX o iOS, Android o ... • Very latest frameworks • Cutting edge Server holds: • ViewModel • Model Server technology: • Java EE • Approved patterns • Stable platform
  • 14. THE SOFTWARE EXPERTS Agenda • M V V M • New concept „MVSVM“ • Ankor framework • Ankor live sample • Ankor special features
  • 15. THE SOFTWARE EXPERTS Project „Ankor” • 2013 • http://www.ankor.io • Open Source (Apache License, Version 2.0) • Expandable modular framework o Event driven programming model o Asynchronous processing o Bidirectional client-server communication o Native MVSVM support
  • 16. THE SOFTWARE EXPERTS Ankor Server Client Ankor - Synchronized ViewModel View ViewModel ● Strongly typed ● Behaviour DB Data Binding Change Events Action Events ViewModel ● Type-less ● Only data Model
  • 17. THE SOFTWARE EXPERTS JEE Server Client Ankor - Synchronized ViewModel View ViewModel ● Strongly typed ● Behaviour DB Data Binding Change Events Action Events ViewModel ● Type-less ● Only data Model ViewModel (client side) ● Type-less ● Only data { "tasks": [ {"id": "dda6f7d9-8d5e-4baf-969b-110f654a64e3", "title": "drink less coffee", "completed": false}, {"id": "ff202f81-33b8-4ae3-bf6a-0208714e2261", "title": "get more sleep", "completed": false} ], "filter": "all", "itemsLeft": 2 } ViewModel (server side) ● Strongly typed ● Behaviour public class TaskListViewModel { private List<Task> tasks; private String filter; private Integer itemsLeft; // getters and setters } public class Task { private String id; private String title; private boolean completed; // getters and setters }
  • 18. THE SOFTWARE EXPERTS JavaFX HTML5 iOS .NET Messaging (Connector HTTP, Websocket, JMS, ...) Ankor Framework JEE Server DB Ankor – Architecture overview View ViewModel Model
  • 19. THE SOFTWARE EXPERTS Ankor – Client Architecture • Various client languages und platforms o Java  JavaFX  Android o Javascript / HTML5  jQuery  AngularJS  React o Objective-C  iOS o C#  .NET / WPF JavaFX HTML5 iOS .NET Messaging (HTTP, Websocket, JMS, ...) Ankor Framework JEE Server
  • 20. THE SOFTWARE EXPERTS Ankor – Server Architecture • Java SE 1.6 (or higher) • Various network protocols o Socket o HTTP-Polling o Websocket • Messaging o JSON • Concurrency / Parallelization o Simple Synchronization o Akka Actors • JEE / Web Container JavaFX HTML5 iOS .NET Messaging (HTTP, Websocket, JMS, ...) Ankor Framework o Glassfish (Websocket) o Tomcat o Spring Boot (Websocket, embedded Tomcat) JEE Server
  • 21. THE SOFTWARE EXPERTS Agenda • M V V M • New concept „MVSVM“ • Ankor framework • Ankor live sample • Ankor special features
  • 22. THE SOFTWARE EXPERTS Ankor - iOS Example
  • 23. THE SOFTWARE EXPERTS Ankor - iOS Example Start Ankor System, connect to server [[[ANKSystem alloc] initWith:@"root" connectParams:connectParams url:@"ws://localhost:8080/websocket/ankor" useWebsocket:YES] start];
  • 24. THE SOFTWARE EXPERTS Register Change Listener [ANKRefs observe:@"root.model.tasks" target:self listener:@selector(tasksChanged:)]; Change Listener - (void)tasksChanged:(id) value { [[self toDoItems]removeAllObjects]; [[self toDoItems]addObjectsFromArray:value]; [self.tableView reloadData]; } Ankor - iOS Example
  • 25. THE SOFTWARE EXPERTS Ankor - iOS Example Fire Action / Add a new Task [ANKRefs fireAction:@"root.model" name:@"newTask" params:params]; // Dictionary ActionListener Java @ActionListener public void newTask(@Param("title") final String title) {...}
  • 26. THE SOFTWARE EXPERTS Agenda • M V V M • New concept „MVSVM“ • Ankor framework • Ankor live sample • Ankor special features
  • 27. THE SOFTWARE EXPERTS Client Ankor - Special Features Server • Ankor Annotations • Ankor Big Collections o BigList o BigMap • Ankor Flood Control • Pluggable Bean-Factory o Simple/Reflection o Spring o CDI (planned) • Collaboration Support • Stateless Server Model public class AnimalSearchViewModel { private AnimalSearchFilter filter; @ChangeListener(pattern = {".filter.**"}) public void reloadAnimals() { this.animals = animalRepository.searchAnimals(filter); }
  • 28. THE SOFTWARE EXPERTS Server public class AnimalSearchViewModel { private List<Animal> animals = new ArrayList<Animal>(10000); @AnkorBigList(chunkSize = 10) public List<Animal> getAnimals() { return animals; } send 10 rows at once – on demand only! • Ankor Annotations • Ankor Big Collections o BigList o BigMap • Ankor Flood Control • Pluggable Bean-Factory o Simple/Reflection o Spring o CDI (planned) • Collaboration Support • Stateless Server Model Ankor - Special Features Client
  • 29. THE SOFTWARE EXPERTS Ankor - Special Features Server • Ankor Annotations • Ankor Big Collections o BigList o BigMap • Ankor Flood Control • Pluggable Bean-Factory o Simple/Reflection o Spring o CDI (planned) • Collaboration Support • Stateless Server Model public class AnimalSearchViewModel { @ChangeListener(pattern = {".filter.**"}) @AnkorFloodControl(delayMillis = 100L) public void reloadAnimals() { this.animals = animalRepository.searchAnimals(filter); } Client
  • 30. THE SOFTWARE EXPERTS Server Shared ViewModel • Ankor Annotations • Ankor Big Collections o BigList o BigMap • Ankor Flood Control • Pluggable Bean-Factory o Simple/Reflection o Spring o CDI (planned) • Collaboration Support • Stateless Server Model Ankor - Special Features
  • 31. THE SOFTWARE EXPERTS Server • Ankor Annotations • Ankor Big Collections o BigList o BigMap • Ankor Flood Control • Pluggable Bean-Factory o Simple/Reflection o Spring o CDI (planned) • Collaboration Support • Stateless Server Model Ankor - Special Features send state information public class TaskListModel { @StateHolder private Filter filter; public void setFilter(String filter) { this.filter = Filter.valueOf(filter); initCalculatedFields(); }
  • 32. THE SOFTWARE EXPERTS Ankor.io Further information, documentation & tutorials http://ankor.io http://github.com/ankor-io Thomas Spiegl Manfred Geiler