Today's Spring framework
Upcoming SlideShare
Loading in...5
×
 

Today's Spring framework

on

  • 744 views

 

Statistics

Views

Total Views
744
Views on SlideShare
741
Embed Views
3

Actions

Likes
0
Downloads
6
Comments
0

2 Embeds 3

http://www.linkedin.com 2
https://twitter.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Today's Spring framework Today's Spring framework Presentation Transcript

    • 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!