2013 java2 days web apps - a different angle
-
Upload
ioan-stan -
Category
Technology
-
view
896 -
download
1
description
Transcript of 2013 java2 days web apps - a different angle
![Page 1: 2013 java2 days web apps - a different angle](https://reader033.fdocuments.us/reader033/viewer/2022051015/554f5e50b4c9058a148b45e1/html5/thumbnails/1.jpg)
Web apps: a different angle
Spring {data,data-rest} with
Angular.js and Bootstrap
Ioan Eugen Stan
![Page 2: 2013 java2 days web apps - a different angle](https://reader033.fdocuments.us/reader033/viewer/2022051015/554f5e50b4c9058a148b45e1/html5/thumbnails/2.jpg)
About me - Ioan Eugen Stan
● founder & organizer of Bucharest JUG http://bjug.ro/● Apache comitter and PMC - Apache James & Apache
Provisionr (Incubator)● Debian user and contributor - maintainer wanabee● OpenJDK supporter
![Page 3: 2013 java2 days web apps - a different angle](https://reader033.fdocuments.us/reader033/viewer/2022051015/554f5e50b4c9058a148b45e1/html5/thumbnails/3.jpg)
Why this talk?
Today’s web app needs to
● respond fast to user needs (easy to extend)
● share data with others (mash-up)
● be mobile (friendly)
● scale well
![Page 4: 2013 java2 days web apps - a different angle](https://reader033.fdocuments.us/reader033/viewer/2022051015/554f5e50b4c9058a148b45e1/html5/thumbnails/4.jpg)
What are we building?REST services with Database persistance
and Angular JS client
![Page 5: 2013 java2 days web apps - a different angle](https://reader033.fdocuments.us/reader033/viewer/2022051015/554f5e50b4c9058a148b45e1/html5/thumbnails/5.jpg)
Spring Data
● Spring umbrella project
● simplifies data access
● CRUD on steroids
● Declarative query methods○ magic finders
● single API for different technologies
![Page 6: 2013 java2 days web apps - a different angle](https://reader033.fdocuments.us/reader033/viewer/2022051015/554f5e50b4c9058a148b45e1/html5/thumbnails/6.jpg)
Overview
http://www.infoq.com/articles/spring-data-intro
![Page 7: 2013 java2 days web apps - a different angle](https://reader033.fdocuments.us/reader033/viewer/2022051015/554f5e50b4c9058a148b45e1/html5/thumbnails/7.jpg)
The “magic”
http://bearprogrammer.com/2012/03/26/simple-spring-data-example/
![Page 8: 2013 java2 days web apps - a different angle](https://reader033.fdocuments.us/reader033/viewer/2022051015/554f5e50b4c9058a148b45e1/html5/thumbnails/8.jpg)
Magic Finder keywords
![Page 9: 2013 java2 days web apps - a different angle](https://reader033.fdocuments.us/reader033/viewer/2022051015/554f5e50b4c9058a148b45e1/html5/thumbnails/9.jpg)
How to use Spring Data
![Page 10: 2013 java2 days web apps - a different angle](https://reader033.fdocuments.us/reader033/viewer/2022051015/554f5e50b4c9058a148b45e1/html5/thumbnails/10.jpg)
Spring Data Rest
● expose Repositories as REST endpoints
● uses SpringMVC
● Servlet based
● provides HATEOS
![Page 11: 2013 java2 days web apps - a different angle](https://reader033.fdocuments.us/reader033/viewer/2022051015/554f5e50b4c9058a148b45e1/html5/thumbnails/11.jpg)
HATEOAS
http://azagorneanu.blogspot.ro/2013/06/hateoas-using-spring-framework.html
![Page 12: 2013 java2 days web apps - a different angle](https://reader033.fdocuments.us/reader033/viewer/2022051015/554f5e50b4c9058a148b45e1/html5/thumbnails/12.jpg)
Spring Rest Shell
● command line REST tool
● explore and test HATEOS services
● demo
![Page 13: 2013 java2 days web apps - a different angle](https://reader033.fdocuments.us/reader033/viewer/2022051015/554f5e50b4c9058a148b45e1/html5/thumbnails/13.jpg)
Webjars
● Explicitly and easily manage the client-side
dependencies in JVM-based web apps
● Use JVM-based build tools (e.g. Maven,
Gradle, & SBT)
● Transitive dependencies magically appear
![Page 14: 2013 java2 days web apps - a different angle](https://reader033.fdocuments.us/reader033/viewer/2022051015/554f5e50b4c9058a148b45e1/html5/thumbnails/14.jpg)
Bootstrap
Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web
development.
Build good looking responsive web apps fast
![Page 15: 2013 java2 days web apps - a different angle](https://reader033.fdocuments.us/reader033/viewer/2022051015/554f5e50b4c9058a148b45e1/html5/thumbnails/15.jpg)
JavaScript library for web apps
● very clean MVC implementation
● clean data binding
● declarative UI (HTML)
● model is POJO
● encourages modularity and unit testing
![Page 16: 2013 java2 days web apps - a different angle](https://reader033.fdocuments.us/reader033/viewer/2022051015/554f5e50b4c9058a148b45e1/html5/thumbnails/16.jpg)
How it works
http://devgirl.org/2013/03/21/fun-with-angularjs/
![Page 17: 2013 java2 days web apps - a different angle](https://reader033.fdocuments.us/reader033/viewer/2022051015/554f5e50b4c9058a148b45e1/html5/thumbnails/17.jpg)
Jasmine Maven Plugin
Maven plugin for the JavaScript testing framework, Jasmine
● practice TDD/BDD as you write JavaScript● run frontend tests at the same time with
back-end
![Page 18: 2013 java2 days web apps - a different angle](https://reader033.fdocuments.us/reader033/viewer/2022051015/554f5e50b4c9058a148b45e1/html5/thumbnails/18.jpg)
Resources
● app code here: https://github.com/ieugen/angular-ui ● https://github.com/spring-projects/rest-shell● http://projects.spring.io/spring-data/● http://projects.spring.io/spring-data-rest/● http://angularjs.org/● http://getbootstrap.com/● http://www.webjars.org/● http://www.slideshare.net/KubaKubryski/spring-data-
24027228