http://www.opitz-consulting.com/go/3-4-898
JavaScript-Anwendungen werden immer leistungsfähiger, aber auch immer komplexer. Wie kann eine Anwendung trotz wachsender Größe wartbar und testbar bleiben? Entwurfsmuster helfen, dieses Ziel zu erreichen.
Stefan Scheidt, Solution Architect und Mobile-Web-Experte bei OPITZ CONSULTING, hielt diesen Vortrag bei der Mobile Tech Conference in Frankfurt a. M am 04.September 2012.
--
Zukunft?! Wir arbeiten dran.
Mobile Solutions by OPITZ CONSULTING
http://www.opitz-consulting.com/go/3-4-898
Über uns:
Als führender Projektspezialist für ganzheitliche IT-Lösungen tragen wir zur Wertsteigerung der Organisationen unserer Kunden bei und bringen IT und Business in Einklang. Mit OPITZ CONSULTING als zuverlässigem Partner können sich unsere Kunden auf ihr Kerngeschäft konzentrieren und ihre Wettbewerbsvorteile nachhaltig absichern und ausbauen.
Über unsere IT-Beratung: http://www.opitz-consulting.com/go/3-8-10
Unser Leistungsangebot: http://www.opitz-consulting.com/go/3-8-874
Karriere bei OPITZ CONSULTING: http://www.opitz-consulting.com/go/3-8-5
45. jQuery Mobile und AngularJS
Das Problem:
Die DOM-Manipulationen von
jQuery Mobile und AngularJS
müssen koordiniert werden!
46. jQuery Mobile und AngularJS
Die Lösung:
jQuery Mobile Angular Adapter
47. jQuery Mobile Angular Adapter
Koordination von jQuery Mobile und AngularJS
Erweiterungen für mobile Web-Apps
Open Source unter
https://github.com/tigbro/
jquery-mobile-angular-adapter
49. Dependency Injection ist ein Entwurfsmuster
und dient dazu, die Abhängigkeiten zwischen
Komponenten zu minimieren.
Es überträgt die Verantwortung für das
Erzeugen und die Verknüpfung von Objekten an
ein extern konfigurierbares Framework
http://de.wikipedia.org/wiki/Dependency_Injection
50. Dependency Injection ist ein Entwurfsmuster
und dient dazu, die Abhängigkeiten zwischen
Komponenten zu minimieren.
Es überträgt die Verantwortung für das
Erzeugen und die Verknüpfung von Objekten an
ein extern konfigurierbares Framework
http://de.wikipedia.org/wiki/Dependency_Injection
53. Beispiel: Backend-Anbindung
var readUrl = 'https://secure.openkeyval.org/';
function read(key, success) {
var url = readUrl + key;
waitdialog.show();
jsonp(url, function(data) {
success(data);
waitdialog.hide();
});
}
54. Beispiel: Backend-Anbindung
var readUrl = 'https://secure.openkeyval.org/';
function read(key, success) {
var url = readUrl + key;
waitdialog.show();
jsonp(url, function(data) {
success(data);
waitdialog.hide();
});
}
55. Beispiel: Backend-Anbindung
var readUrl = 'https://secure.openkeyval.org/';
function read(key, success) {
var url = readUrl + key;
waitdialog.show();
jsonp(url, function(data) {
success(data);
waitdialog.hide();
});
}
56. Beispiel: Backend-Anbindung
waitDialog
todoController todoStore key value
key value key value ... ...
refreshTodos ... read ...
todoStore waitDialog
jsonp jsonp
key value
... ...
created by
Factories
57. Beispiel: Backend-Anbindung
waitDialog
todoController todoStore key value
key value key value ... ...
refreshTodos ... read ...
todoStore waitDialog
jsonp jsonp
key value
... ...
created by
Dependency Injection
58. Angular JS
Declarative MVC with
UI Templates Dependency Injection
Two-Way Framework
Data Binding
http://angularjs.org/#/
59. Services und DI mit Angular
function jsonpFactory() {
// returns jsonp function
// ...
}
function waitdialogFactory() {
// returns waitdialog object
// ...
}
60. Services und DI mit Angular
var module = angular.module("todo", []);
61. Services und DI mit Angular
var module = angular.module("todo", []);
module.factory('jsonp', jsonpFactory);
module.factory('waitdialog', waitdialogFactory);
62. Services und DI mit Angular
var module = angular.module("todo", []);
module.factory('jsonp', jsonpFactory);
module.factory('waitdialog', waitdialogFactory);
function todoStoreFactory(jsonp, waitdialog) {
function read(key, success) {
// use jsonp, waitdialog here
}
return {
read: read
};
}
63. Services und DI mit Angular
var module = angular.module("todo", []);
module.factory('jsonp', jsonpFactory);
module.factory('waitdialog', waitdialogFactory);
function todoStoreFactory(jsonp, waitdialog) {
function read(key, success) {
// use jsonp, waitdialog here
}
return {
read: read
};
}
todoStoreFactory.$inject = ['jsonp', 'waitdialog'];
64. Services und DI mit Angular
var module = angular.module("todo", []);
module.factory('jsonp', jsonpFactory);
module.factory('waitdialog', waitdialogFactory);
function todoStoreFactory(jsonp, waitdialog) {
// ...
}
todoStoreFactory.$inject = ['jsonp', 'waitdialog'];
module.factory('todoStore', todoStoreFactory);
65. Controller und DI mit Angular
function TodoController($scope, todoStore) {
...
}
TodoController.$inject = ['$scope', 'todoStore'];
module.controller("rylc.TodoController", TodoController);
66. Controller und DI mit Angular
function TodoController($scope, todoStore) {
...
}
TodoController.$inject = ['$scope', 'todoStore'];
module.controller("rylc.TodoController", TodoController);
67. Controller und DI mit Angular
function TodoController($scope, todoStore) {
...
}
TodoController.$inject = ['$scope', 'todoStore'];
module.controller("rylc.TodoController", TodoController);
68. jQuery Mobile Angular Adapter
Koordination von jQuery Mobile und AngularJS
Erweiterungen für mobile Web-Apps
Open Source unter
https://github.com/tigbro/
jquery-mobile-angular-adapter
81. In the hive 11: nectar and pollen
by Max xx, http://www.flickr.com/photos/max_westby/4567762490
Books
By Rodrigo Galindez, http://www.flickr.com/photos/rodrigogalindez/4637637337/
IMG_1300-Edit
by Susan E Adams, http://www.flickr.com/photos/susanad813/3912914836/
Doble Via
by amslerPIX, http://www.flickr.com/photos/amslerpix/6242266697/
MacBook Pro Keyboard
by superstrikertwo, http://www.flickr.com/photos/superstrikertwo/4989727256/
Stubborn Last Drop
by RogueSun Media, http://www.flickr.com/photos/shuttercat7/627798443/