Slide 1

Slide 1 text

Wir lösen das – persönlich! Tragfähige Frontend-Architekturen Till Schulte-Coerne JavaLand 2014

Slide 2

Slide 2 text

© 2014 innoQ Deutschland GmbH Frontend-Architektur?

Slide 3

Slide 3 text

© 2014 innoQ Deutschland GmbH Frontend Backend DB Fertig! So ware-Architektur!

Slide 4

Slide 4 text

© 2014 innoQ Deutschland GmbH Was wo hin? Rest Geschä slogik Daten HTML? CSS? JavaScript? PHP? JSF? Play? HTTP? ...? Frontend Backend DB

Slide 5

Slide 5 text

© 2014 innoQ Deutschland GmbH „Realität“ Das „Internet“ Frontend Backend DB Browser

Slide 6

Slide 6 text

© 2014 innoQ Deutschland GmbH Im Großen Frontend Backend 1 Backend 2 Backend 3

Slide 7

Slide 7 text

© 2014 innoQ Deutschland GmbH Soll Frontend Backend 1 Backend 2 Backend 3

Slide 8

Slide 8 text

© 2014 innoQ Deutschland GmbH „Klassischer Schnitt“ Klassisches Enterprise-Modell Fette Backend-Services Wenig Frontend-Logik Browser == Notweniges Übel ?

Slide 9

Slide 9 text

© 2014 innoQ Deutschland GmbH Soll Backend 2 Backend 1 Backend 3 Frontend

Slide 10

Slide 10 text

© 2014 innoQ Deutschland GmbH Ist Frontend Backend 2 Backend 1 Backend 3 ?↯

Slide 11

Slide 11 text

© 2014 innoQ Deutschland GmbH Logische Weiterentwicklung? Backend 2 Backend 1 Backend 3 Frontend im Browser

Slide 12

Slide 12 text

© 2014 innoQ Deutschland GmbH Single Page Apps

Slide 13

Slide 13 text

© 2014 innoQ Deutschland GmbH MVC im Browser MVC oder MVP MVC, MVP oder MVVM Rich Client

Slide 14

Slide 14 text

© 2014 innoQ Deutschland GmbH Backend-Services per Ajax (Modell) Client-seitiges Routing Templating Data-Binding Applikationslogik (Controller) Mögliche Features

Slide 15

Slide 15 text

© 2014 innoQ Deutschland GmbH Ajax + X Backend-Services $.get("/foo.json", function(e) { machWas(e.data); }); App.Post = DS.Model.extend({ title: DS.attr('string'), content: DS.attr('string'), comments: DS.hasMany('App.Comment') }); App.Comment = DS.Model.extend({ author: DS.attr('string'), content: DS.attr('string'), post: DS.belongsTo('App.Post') }); Ember Data „plain jQuery“

Slide 16

Slide 16 text

© 2014 innoQ Deutschland GmbH Data-Binding var myViewModel = { personName: ko.observable('Bob'), personAge: ko.observable(123) }; Hallo ! myViewModel.personName('Mary'); KnockoutJS

Slide 17

Slide 17 text

© 2014 innoQ Deutschland GmbH Templating
... <h3 data-bind="text: name"></h3> <p>Age: <span data-bind="text: personAge"></span></p> KnockoutJS

Slide 18

Slide 18 text

© 2014 innoQ Deutschland GmbH Routing $routeProvider. when('/', {controller:ListCtrl, templateUrl:'list.html'}). when('/edit/:projectId', {controller:EditCtrl, templateUrl:'detail.html'}). when('/new', {controller:CreateCtrl, templateUrl:'detail.html'}). otherwise({redirectTo:'/'} AngularJS History API? http://example.com/ http://example.com/edit/4711 htto://example.com/new m it http://example.com/index.html#/ http://example.com/index.html#/edit/4711 htto://example.com/index.html#/new ohne

Slide 19

Slide 19 text

© 2014 innoQ Deutschland GmbH Frameworks und Bibliotheken Typ Modelle Routing Templating Data binding AngularJS KnockoutJS EmberJS BackboneJS ⋯ Framework Ressourcen Optional Eingebaut Zentral Bibliothek — Optional Eingebaut Zentral Framework Objekte Zentral Eingebaut Re-Render Bibliothek Ressourcen Optional Wahlweise Re-Render http://blog.stevensanderson.com/2012/08/01/rich-javascript-applications-the-seven-frameworks-throne-of-js-2012/

Slide 20

Slide 20 text

© 2014 innoQ Deutschland GmbH Single Page Apps Neues Enterprise-Modell? Tragfähige Architektur Kein aufgeteiltes Frontend

Slide 21

Slide 21 text

© 2014 innoQ Deutschland GmbH Single Page Apps Backend 2 Backend 1 Backend 3 Frontend-App im Browser

Slide 22

Slide 22 text

© 2014 innoQ Deutschland GmbH Multi Single Page Apps Link Backend 2 Backend 1 Backend 3 SPA 1 SPA 2

Slide 23

Slide 23 text

© 2014 innoQ Deutschland GmbH Zurück zum Anfang

Slide 24

Slide 24 text

© 2014 innoQ Deutschland GmbH Browser Frontend Backend Daten

Slide 25

Slide 25 text

© 2014 innoQ Deutschland GmbH Browser Backend Daten

Slide 26

Slide 26 text

© 2014 innoQ Deutschland GmbH Anwendung 1 Anwendung 2 Anwendung 3

Slide 27

Slide 27 text

© 2014 innoQ Deutschland GmbH Reverse Proxy Anwendung 1 Anwendung 2 Anwendung 3

Slide 28

Slide 28 text

© 2014 innoQ Deutschland GmbH ROCA

Slide 29

Slide 29 text

© 2014 innoQ Deutschland GmbH RESTful Web-Frontends

Slide 30

Slide 30 text

© 2014 innoQ Deutschland GmbH Deeplinks „Nahtlose“ Übergänge Zustandslosigkeit

Slide 31

Slide 31 text

© 2014 innoQ Deutschland GmbH Applikationslogik ausschließlich auf dem Server

Slide 32

Slide 32 text

© 2014 innoQ Deutschland GmbH Vertraue niemals dem Client Nicht-Browser Clients (z.B. Google Crawler)

Slide 33

Slide 33 text

© 2014 innoQ Deutschland GmbH Keine Duplikation von Logik auf dem Client

Slide 34

Slide 34 text

© 2014 innoQ Deutschland GmbH Sämtliche Applikationslogik auf dem Server Keine Duplikation von Logik auf den Client + = Keine Applikationslogik auf dem Client!

Slide 35

Slide 35 text

© 2014 innoQ Deutschland GmbH Unobtrusive JavaScript verwenden

Slide 36

Slide 36 text

© 2014 innoQ Deutschland GmbH Ein Link

Slide 37

Slide 37 text

© 2014 innoQ Deutschland GmbH Ein Link

Slide 38

Slide 38 text

© 2014 innoQ Deutschland GmbH $("a.whatever").click(function() { doSomething(this.href); }); + Ein Link

Slide 39

Slide 39 text

© 2014 innoQ Deutschland GmbH

Proin elit arcu, rutrum commodo, vehicula ...

Morbi tincidunt, dui sit amet facilisis feugiat, odio ...

Mauris eleifend est et turpis. Duis id erat ...

$("#tabs").tabs(); +

Slide 40

Slide 40 text

© 2014 innoQ Deutschland GmbH

Slide 41

Slide 41 text

© 2014 innoQ Deutschland GmbH SPA vs. ROCA

Slide 42

Slide 42 text

© 2014 innoQ Deutschland GmbH Single Page Apps

Slide 43

Slide 43 text

© 2014 innoQ Deutschland GmbH Backend 2 Backend 1 Backend 3 SPA Nachteile SPA MONOLITH

Slide 44

Slide 44 text

© 2014 innoQ Deutschland GmbH Backend 2 Backend 1 Backend 3 SPA Nachteile SPA Validierungen? REDUNDANZEN

Slide 45

Slide 45 text

© 2014 innoQ Deutschland GmbH Backend 2 Backend 1 Backend 3 SPA Nachteile SPA ? KEINE „NATIVE“ DURCHSUCHBARKEIT

Slide 46

Slide 46 text

© 2014 innoQ Deutschland GmbH Backend 2 Backend 1 Backend 3 Vorteile SPA SPA ORCHESTRIERUNG (BESTEHENDER) SERVICES

Slide 47

Slide 47 text

© 2014 innoQ Deutschland GmbH Backend 2 Backend 1 Backend 3 Vorteile SPA SPA ORCHESTRIERUNG KOSTET Integrations Backend

Slide 48

Slide 48 text

© 2014 innoQ Deutschland GmbH Nativer Mobile Client Backend 1 Vorteile SPA EIN CLIENT UNTER VIELEN Backend 2 Backend 3 SPA

Slide 49

Slide 49 text

© 2014 innoQ Deutschland GmbH Backend 1 Vorteile SPA OFFLINE- FÄHIGKEIT Backend 2 Backend 3 SPA

Slide 50

Slide 50 text

© 2014 innoQ Deutschland GmbH Backend 2 Backend 1 Backend 3 JavaScript Java PHP Scala Vorteile SPA KLARE VERANTWORT- LICHKEITEN SPA

Slide 51

Slide 51 text

© 2014 innoQ Deutschland GmbH ROCA Vertikalen-Architektur

Slide 52

Slide 52 text

© 2014 innoQ Deutschland GmbH Nachteile ROCA HTML, JS, CSS Webframework SQL, Cobol-Integration, ...? VIEL KNOW-HOW

Slide 53

Slide 53 text

© 2014 innoQ Deutschland GmbH Vorteile ROCA MONOLITHEN- VERMEIDUNG

Slide 54

Slide 54 text

© 2014 innoQ Deutschland GmbH Vorteile ROCA KLARE VERANTWORT- LICHKEITEN Darstellung Business-Logik

Slide 55

Slide 55 text

© 2014 innoQ Deutschland GmbH Vorteile ROCA TECHNOLOGIE- UNABHÄNGIGKEIT Play 2 Rails Spring MVC

Slide 56

Slide 56 text

© 2014 innoQ Deutschland GmbH Vielen Dank! Fragen? Anmerkungen? Till Schulte-Coerne, @tillsc till.schulte-coerne@innoq.com innoQ Deutschland GmbH Krischerstr. 100 40789 Monheim am Rhein Germany Phone: +49 2173 3366-0 innoQ Schweiz GmbH Gewerbestr. 11 CH-6330 Cham Switzerland Phone: +41 41 743 0116 www.innoq.com Ohlauer Straße 43 10999 Berlin Germany Phone: +49 2173 3366-0 Robert-Bosch-Straße 7 64293 Darmstadt Germany Phone: +49 2173 3366-0 Radlkoferstraße 2 D-81373 München Germany Telefon +49 (0) 89 741185-270