SlideShare ist ein Scribd-Unternehmen logo
1 von 44
Downloaden Sie, um offline zu lesen
- Björn Wilmsmann -
ZenQuery - Enterprise
Backend as a Service
Single Page Applications
mit AngularJS und Spring MVC
ZenQuery
• Enterprise Backend as a Service
• Unternehmen horten Daten in Silos
• ZenQuery macht diese Daten verfügbar
• REST APIs für Datenbanktabellen und SQL
Queries
• SELECT * FROM … -> JSON, XML, CSV …
Technologien
• AngularJS
• Spring Web MVC
• REST
• JSON
• JdbcTemplate
• PostgreSQL (und H2, Oracle, MySQL …)
Warum Spring Web
MVC?
Warum AngularJS?
"I’ll use Go, Rust and
MongoDB for the
back end and Dart or
CoffeeScript for the
front end"
WTF?!
Problemlösungen
statt Technologie
als Selbstzweck
AngularJS
• Single Page Applications
• MVVM: Model View ViewModel
• MVW: Model View Whatever
• Two-Way Data Binding
• Directives
Single Page Apps
• UX ähnlich Desktop Anwendungen
• Sämtlicher Code - HTML, CSS, JS - wird
beim ersten Aufruf vollständig geladen
• Keine vollständigen Reloads
• Statt dessen: Partielle DOM Aktualisierung
Model
• Services
• Factories
• Providers
View
• Directives
• wieder verwendbare HTML View
Komponenten
• eigene HTML Tags
• {{ interpolated_variables }}
ViewModel
• Controllers
• nicht mit Controller aus MVC zu
verwechseln
• eher: Scope
• Modules
• fassen Features und wiederverwendbare
Komponenten logisch zusammen
Dependency Injection
• Von Spring "abgeguckt"
• Abhängigkeiten können wo benötigt
eingebunden werden
• Controller
• Service
• …
Routing
• Erlaubt Zuordnung von Controllern und
Views zu URLs und Parametern
• Erlaubt Deep Links in Single Page
Applications
• /ui/index.html#/databaseConnections
Services
• Einbindung externer Ressourcen
• z.B. REST APIs
• Shared Functionality
• Entsprechen dem Model
Kommunikation
• $scope
• Dient dem Austausch von Daten
• Two-Way Data Binding
• völlig automatisch … meistens
• $scope.$apply
Exkurs: Promises
• JavaScript ist single-threaded
• Nebenläufigkeit über Events
• Callbacks und Callback Hell
• Promises: Einfache Syntax auch für
komplexe Callback Szenarios
Exkurs: Promises
Exkurs: Promises
Testbarkeit
• AngularJS: Testbarkeit als Design Kriterium
• Jasmine: BDD Framework
• BDD: Behaviour Driven Development
• e2e Testing: Protractor
Spring Web MVC
• Eigenes Spring Web Framework
• "Antwort" auf Probleme mit Struts
• Request-basiert
• Eng mit Servlet API gekoppelt
• Aber: Hohes Abstraktionsniveau
AbstractInterruptibleBatch
PreparedStatementSetter
and
AbstractSingleton
ProxyFactoryBean
no more!
Subjektiv: Spring 4 geht
deutlich leichter von der
Hand als frühere Spring
Versionen.
Subjektiv:
Spring Web MVC
• URL Mapping
• Controllers
• Views
• Forms
• Form Tags
• Model: Key-Value Map
• Annotations
Annotations
• @Controller
• @RequestMapping
• @ResponseBody
• @PathVariable
• @MatrixVariable
• @RequestMethod
• @RequestParam
Spring als REST
Backend
• Controller dienen als REST API Endpoints
• Views sind JSON, XML, CSV Ausgaben
• POJOs automatisch in JSON konvertiert
• Werden vom Front End weiter verarbeitet
Ein paar gängige
Probleme …
"There are only two hard
things in Computer Science:
Cache invalidation, naming
things, and off-by-one
errors."
Caching
• Wann sollte man REST Anfragen cachen?
• Wann sollte man den Cache leeren?
• It depends …
• SELECT, INSERT, UPDATE, DELETE
• @Cacheable, @CacheEvict
CORS
• Cross-Origin Resource Sharing
• JavaScript Beschränkung
• Request nur innerhalb des gleichen Hosts
• Problem während der Entwicklung
• Eigener Response Header nötig:
CORSFilter
XML Conversion
• XML Konvertierung von Java Objekten
funktioniert nicht out-of-the-box
• Jackson
• XStream
• MapEntryConverter
CSV Ausgabe
• Muss manuell programmiert werden
• Eigener CSV Builder
• StringBuilder
Bootstrapping
• Initialaufwand ist bei Java immer noch
sehr hoch (im Vergleich zu Rails und Co.)
• Maven, Jetty, Spring, you name it …
• Keine Single Best Practice hinsichtlich
Struktur und Komponenten
• IDEs wie Intellij IDEA bieten Templates als
Abhilfe
Build Prozess
ZenQuery
Links
• http://www.zenqry.com/
• https://angularjs.org/
• http://docs.spring.io/spring/docs/current/
spring-framework-reference/html/mvc.html
• https://circleci.com/
• https://heroku.com/
• http://www.divshot.com/
Björn Wilmsmann

Stefan-George-Str. 15a

46117 Oberhausen
!
Website: http://wilmsmann.de 

eMail: bjoern@wilmsmann.de

Tel.: +49-151-25209060

Weitere ähnliche Inhalte

Empfohlen

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Empfohlen (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

"ZenQuery - Enterprise Backend as a Service" - Single Page Applications mit AngularJS und Spring MVC