SlideShare a Scribd company logo
1 of 15
Download to read offline
Today’s Spring
framework
Backbase Inspiration Lab

21 Nov 2013

Zoltan Altfatter
Agenda
Overview of Spring IO platform

Spring Boot

Spring Data

Hypermedia with Spring HATEOAS

CloudFoundry 

Demo Application

Q&A
Pivotal Initiative
Spring (including Grails, RabbitMQ, Tomcat,
Redis, GemFire)

Cloudfoundry (the open PaaS (Platform as a
Service))

Greenplum (analytic data warehouse using
Hadoop)
The Spring IO platform
Spring Boot
inspired by Dropwizard

takes an opinionated view

convention-over-configuration

make you focus on the application

spring command line tool - run Groovy scripts

Embed Tomcat or Jetty directly

unlike Spring Roo, no code generation

no requirement for XML configuration
Spring Boot Grooy Demo
Spring Data
Umbrella project for data
access

subprojects: JPA, MongoDB,
Redis, Neo4J, GemFire

Community managed
subprojects: Elasticsearch,
Solr, CouchDB, Riak

Common concept: Repository,
following the repository design
pattern

Repository, CrudRepository,
PagingAndSortingRepository
Spring Data JPA
public interface RestaurantRepository extends 

CrudRepository<Restaurant, Long>, RestaurantRepositoryCustom {


!
Restaurant findByName(String name);


!
Page<Restaurant> findByAddressPostcode(String postcode, Pageable pageable);

}
interface RestaurantRepositoryCustom {

void removeRestaurantWithWebsite(Website website);

}

class RestaurantRepositoryImpl implements RestaurantRepositoryCustom {

@PersistenceContext

private EntityManager em;


!
@Override

public void removeRestaurantWithWebsite(Website website) {

TypedQuery<Restaurant> query = 

em.createQuery("from Restaurant where website like :website", Restaurant.class);

query.setParameter("website", website);

em.remove(query.getSingleResult());

}

}
Hypermedia with Spring Hateoas
HATEOAS: Hypermedia As The
Engine Of Application State

hyper-text driven REST web
services

we are encoding metadata, or
hypermedia, along with the
repsonse

Resources discoverable through
publication of links that point to the
available resources

Spring Hateoas: provide an API to
simplify the creation of hypermedia
links and assembling the REST
resource representation
Example hyper-text REST response
curl -v -H "Accept: application/json" http:/
/localhost:8080/resturants/1
< HTTP/1.1 200 OK

< X-Application-Context: application

< Content-Type: application/json

< Transfer-Encoding: chunked

< Server: Jetty(8.1.9.v20130131)

<

{

"name" : "Cafe Olivier",

"website" : {

"value" : "http:/
/www.cafeolivier.nl"

},

"links" : [ {

"rel" : "self",

"href" : "http:/
/localhost:8080/restaurants/1"

}, {

"rel" : "address",

"href" : "http:/
/localhost:8080/restaurants/1/address"

}, {

"rel" : "reviews",

"href" : "http:/
/localhost:8080/restaurants/1/reviews"

} ]

}
Spring in the cloud
The deployment targets for modern applications
vary considerably

Java EE, Apache Tomcat/Jetty, 

Cloud (AWS, Google App Engine, Heroku,
OpenShift, CloudFoundry)

CloudFoundry - the open PaaS https:/
/
github.com/cloudfoundry

You can install it in your datacenter (cf-vagrantinstaller using Chef, recommended way is BOSH)

https:/
/run.pivotal.io
Demo application
Further tasks
Use SQL service (cleardb) provided by
CloudFoundry

Store the model in MongoDB using Spring Data

Using profiles switch between datastores on
CloudFoundry

Setup local CloudFoundry environment

Add security to REST endpoints
Social coordinates
https:/
/github.com/altfatterz/reviews

https:/
/github.com/altfatterz/spring-bootgroovy

twitter: @altfatterz

blog: altfatterz.blogspot.com
Thanks!

More Related Content

Viewers also liked

Realtime Conf - Lightning node.js dev
Realtime Conf - Lightning node.js devRealtime Conf - Lightning node.js dev
Realtime Conf - Lightning node.js devGlenn Block
 
Skb web2.0
Skb web2.0Skb web2.0
Skb web2.0animove
 
HTML Hypermedia APIs and Adaptive Web Design - Nordic APIs
HTML Hypermedia APIs and Adaptive Web Design - Nordic APIsHTML Hypermedia APIs and Adaptive Web Design - Nordic APIs
HTML Hypermedia APIs and Adaptive Web Design - Nordic APIsGustaf Nilsson Kotte
 
Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013
Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013
Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013Gustaf Nilsson Kotte
 
Dev sum hypemedia talk
Dev sum hypemedia talkDev sum hypemedia talk
Dev sum hypemedia talkGlenn Block
 
Building systems with rest
Building systems with restBuilding systems with rest
Building systems with restGlenn Block
 
Deploying web apis on core clr to docker
Deploying web apis on core clr to dockerDeploying web apis on core clr to docker
Deploying web apis on core clr to dockerGlenn Block
 
Bootify your spring application
Bootify your spring applicationBootify your spring application
Bootify your spring applicationJimmy Lu
 

Viewers also liked (9)

Realtime Conf - Lightning node.js dev
Realtime Conf - Lightning node.js devRealtime Conf - Lightning node.js dev
Realtime Conf - Lightning node.js dev
 
Skb web2.0
Skb web2.0Skb web2.0
Skb web2.0
 
HTML Hypermedia APIs and Adaptive Web Design - Nordic APIs
HTML Hypermedia APIs and Adaptive Web Design - Nordic APIsHTML Hypermedia APIs and Adaptive Web Design - Nordic APIs
HTML Hypermedia APIs and Adaptive Web Design - Nordic APIs
 
Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013
Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013
Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013
 
Edge
EdgeEdge
Edge
 
Dev sum hypemedia talk
Dev sum hypemedia talkDev sum hypemedia talk
Dev sum hypemedia talk
 
Building systems with rest
Building systems with restBuilding systems with rest
Building systems with rest
 
Deploying web apis on core clr to docker
Deploying web apis on core clr to dockerDeploying web apis on core clr to docker
Deploying web apis on core clr to docker
 
Bootify your spring application
Bootify your spring applicationBootify your spring application
Bootify your spring application
 

Similar to Today's Spring framework

Leveraging Hadoop in Polyglot Architectures
Leveraging Hadoop in Polyglot ArchitecturesLeveraging Hadoop in Polyglot Architectures
Leveraging Hadoop in Polyglot ArchitecturesThanigai Vellore
 
Designing RESTful APIs
Designing RESTful APIsDesigning RESTful APIs
Designing RESTful APIsanandology
 
Accelerating Application Delivery with OpenShift
Accelerating Application Delivery with OpenShiftAccelerating Application Delivery with OpenShift
Accelerating Application Delivery with OpenShiftPOSSCON
 
Spring HATEOAS
Spring HATEOASSpring HATEOAS
Spring HATEOASYoann Buch
 
LAJUG Napster REST API
LAJUG Napster REST APILAJUG Napster REST API
LAJUG Napster REST APIstephenbhadran
 
Open shift 2.x and MongoDB
Open shift 2.x and MongoDBOpen shift 2.x and MongoDB
Open shift 2.x and MongoDBplarsen67
 
GlueCon 2018: Are REST APIs Still Relevant Today?
GlueCon 2018: Are REST APIs Still Relevant Today?GlueCon 2018: Are REST APIs Still Relevant Today?
GlueCon 2018: Are REST APIs Still Relevant Today?LaunchAny
 
API Platform 2.1: when Symfony meets ReactJS (Symfony Live 2017)
API Platform 2.1: when Symfony meets ReactJS (Symfony Live 2017)API Platform 2.1: when Symfony meets ReactJS (Symfony Live 2017)
API Platform 2.1: when Symfony meets ReactJS (Symfony Live 2017)Les-Tilleuls.coop
 
API Platform: A Framework for API-driven Projects
API Platform: A Framework for API-driven ProjectsAPI Platform: A Framework for API-driven Projects
API Platform: A Framework for API-driven ProjectsLes-Tilleuls.coop
 
Modeling REST API's Behaviour with Text, Graphics or Both?
Modeling REST API's Behaviour with Text, Graphics or Both?Modeling REST API's Behaviour with Text, Graphics or Both?
Modeling REST API's Behaviour with Text, Graphics or Both?Ana Ivanchikj
 
Sofea and SOUI - Web future without web frameworks
Sofea and SOUI - Web future without web frameworksSofea and SOUI - Web future without web frameworks
Sofea and SOUI - Web future without web frameworksAndré Neubauer
 
Using eZ Platform in an API Era
Using eZ Platform in an API EraUsing eZ Platform in an API Era
Using eZ Platform in an API EraeZ Systems
 
Restful web services rule financial
Restful web services   rule financialRestful web services   rule financial
Restful web services rule financialRule_Financial
 
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of ChoicePaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of ChoiceIsaac Christoffersen
 
Drupal In The Cloud
Drupal In The CloudDrupal In The Cloud
Drupal In The CloudBret Piatt
 
Open stack ocata summit enabling aws lambda-like functionality with openstac...
Open stack ocata summit  enabling aws lambda-like functionality with openstac...Open stack ocata summit  enabling aws lambda-like functionality with openstac...
Open stack ocata summit enabling aws lambda-like functionality with openstac...Shaun Murakami
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Mario Cardinal
 

Similar to Today's Spring framework (20)

Leveraging Hadoop in Polyglot Architectures
Leveraging Hadoop in Polyglot ArchitecturesLeveraging Hadoop in Polyglot Architectures
Leveraging Hadoop in Polyglot Architectures
 
Designing RESTful APIs
Designing RESTful APIsDesigning RESTful APIs
Designing RESTful APIs
 
Accelerating Application Delivery with OpenShift
Accelerating Application Delivery with OpenShiftAccelerating Application Delivery with OpenShift
Accelerating Application Delivery with OpenShift
 
Spring HATEOAS
Spring HATEOASSpring HATEOAS
Spring HATEOAS
 
Introduction to Hydra
Introduction to HydraIntroduction to Hydra
Introduction to Hydra
 
Getting Started with API Management
Getting Started with API ManagementGetting Started with API Management
Getting Started with API Management
 
LAJUG Napster REST API
LAJUG Napster REST APILAJUG Napster REST API
LAJUG Napster REST API
 
Open shift 2.x and MongoDB
Open shift 2.x and MongoDBOpen shift 2.x and MongoDB
Open shift 2.x and MongoDB
 
GlueCon 2018: Are REST APIs Still Relevant Today?
GlueCon 2018: Are REST APIs Still Relevant Today?GlueCon 2018: Are REST APIs Still Relevant Today?
GlueCon 2018: Are REST APIs Still Relevant Today?
 
API Platform 2.1: when Symfony meets ReactJS (Symfony Live 2017)
API Platform 2.1: when Symfony meets ReactJS (Symfony Live 2017)API Platform 2.1: when Symfony meets ReactJS (Symfony Live 2017)
API Platform 2.1: when Symfony meets ReactJS (Symfony Live 2017)
 
API Platform: A Framework for API-driven Projects
API Platform: A Framework for API-driven ProjectsAPI Platform: A Framework for API-driven Projects
API Platform: A Framework for API-driven Projects
 
Modeling REST API's Behaviour with Text, Graphics or Both?
Modeling REST API's Behaviour with Text, Graphics or Both?Modeling REST API's Behaviour with Text, Graphics or Both?
Modeling REST API's Behaviour with Text, Graphics or Both?
 
Sofea and SOUI - Web future without web frameworks
Sofea and SOUI - Web future without web frameworksSofea and SOUI - Web future without web frameworks
Sofea and SOUI - Web future without web frameworks
 
Using eZ Platform in an API Era
Using eZ Platform in an API EraUsing eZ Platform in an API Era
Using eZ Platform in an API Era
 
Restful web services rule financial
Restful web services   rule financialRestful web services   rule financial
Restful web services rule financial
 
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of ChoicePaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
 
OpenShift Enterprise
OpenShift EnterpriseOpenShift Enterprise
OpenShift Enterprise
 
Drupal In The Cloud
Drupal In The CloudDrupal In The Cloud
Drupal In The Cloud
 
Open stack ocata summit enabling aws lambda-like functionality with openstac...
Open stack ocata summit  enabling aws lambda-like functionality with openstac...Open stack ocata summit  enabling aws lambda-like functionality with openstac...
Open stack ocata summit enabling aws lambda-like functionality with openstac...
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
 

Recently uploaded

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 

Recently uploaded (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 

Today's Spring framework

  • 1. Today’s Spring framework Backbase Inspiration Lab 21 Nov 2013 Zoltan Altfatter
  • 2. Agenda Overview of Spring IO platform Spring Boot Spring Data Hypermedia with Spring HATEOAS CloudFoundry Demo Application Q&A
  • 3. Pivotal Initiative Spring (including Grails, RabbitMQ, Tomcat, Redis, GemFire) Cloudfoundry (the open PaaS (Platform as a Service)) Greenplum (analytic data warehouse using Hadoop)
  • 4. The Spring IO platform
  • 5. Spring Boot inspired by Dropwizard takes an opinionated view convention-over-configuration make you focus on the application spring command line tool - run Groovy scripts Embed Tomcat or Jetty directly unlike Spring Roo, no code generation no requirement for XML configuration
  • 7. Spring Data Umbrella project for data access subprojects: JPA, MongoDB, Redis, Neo4J, GemFire Community managed subprojects: Elasticsearch, Solr, CouchDB, Riak Common concept: Repository, following the repository design pattern Repository, CrudRepository, PagingAndSortingRepository
  • 8. Spring Data JPA public interface RestaurantRepository extends CrudRepository<Restaurant, Long>, RestaurantRepositoryCustom { ! Restaurant findByName(String name); ! Page<Restaurant> findByAddressPostcode(String postcode, Pageable pageable); } interface RestaurantRepositoryCustom { void removeRestaurantWithWebsite(Website website); } class RestaurantRepositoryImpl implements RestaurantRepositoryCustom { @PersistenceContext private EntityManager em; ! @Override public void removeRestaurantWithWebsite(Website website) { TypedQuery<Restaurant> query = em.createQuery("from Restaurant where website like :website", Restaurant.class); query.setParameter("website", website); em.remove(query.getSingleResult()); } }
  • 9. Hypermedia with Spring Hateoas HATEOAS: Hypermedia As The Engine Of Application State hyper-text driven REST web services we are encoding metadata, or hypermedia, along with the repsonse Resources discoverable through publication of links that point to the available resources Spring Hateoas: provide an API to simplify the creation of hypermedia links and assembling the REST resource representation
  • 10. Example hyper-text REST response curl -v -H "Accept: application/json" http:/ /localhost:8080/resturants/1 < HTTP/1.1 200 OK < X-Application-Context: application < Content-Type: application/json < Transfer-Encoding: chunked < Server: Jetty(8.1.9.v20130131) < { "name" : "Cafe Olivier", "website" : { "value" : "http:/ /www.cafeolivier.nl" }, "links" : [ { "rel" : "self", "href" : "http:/ /localhost:8080/restaurants/1" }, { "rel" : "address", "href" : "http:/ /localhost:8080/restaurants/1/address" }, { "rel" : "reviews", "href" : "http:/ /localhost:8080/restaurants/1/reviews" } ] }
  • 11. Spring in the cloud The deployment targets for modern applications vary considerably Java EE, Apache Tomcat/Jetty, Cloud (AWS, Google App Engine, Heroku, OpenShift, CloudFoundry) CloudFoundry - the open PaaS https:/ / github.com/cloudfoundry You can install it in your datacenter (cf-vagrantinstaller using Chef, recommended way is BOSH) https:/ /run.pivotal.io
  • 13. Further tasks Use SQL service (cleardb) provided by CloudFoundry Store the model in MongoDB using Spring Data Using profiles switch between datastores on CloudFoundry Setup local CloudFoundry environment Add security to REST endpoints