Your SlideShare is downloading. ×
0
Simple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and Vaadin
Simple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and Vaadin
Simple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and Vaadin
Simple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and Vaadin
Simple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and Vaadin
Simple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and Vaadin
Simple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and Vaadin
Simple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and Vaadin
Simple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and Vaadin
Simple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and Vaadin
Simple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and Vaadin
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Simple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and Vaadin

920

Published on

A Simple Open Source Java Cloud App Stack using Google Guice 3.0, Hibernate 4, Jersey 1.x and Vaadin 7

A Simple Open Source Java Cloud App Stack using Google Guice 3.0, Hibernate 4, Jersey 1.x and Vaadin 7

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
920
On Slideshare
0
From Embeds
0
Number of Embeds
17
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. A Simple Open Source Java Cloud App Stack with Google Guice, Hibernate, Jersey and Vaadin Jian Wu 03/09/2014
  • 2. History of Web Frameworks (Adopted from Matt Raible http://raibledesigins.com)
  • 3. How do you choose a Cloud App Framework/Stack? ● Java is still the most mature and reliable language and platform when developing the Web Apps and Services running in the Cloud ● Two must-have features/functionalities for any Cloud Apps and Services: – Serving HTML5 Web UI to the Browsers – Serving data to the Mobile Devices through Restful Services/APIs ● MVC is still the design pattern to guide UI ● ACID is still important for Your Data Integrity (Note: A Java Framework or Tool will be considered first as it can simplify the development process including dev/debugging, testing, deployment and monitoring)
  • 4. Layered Architecture for Java Cloud Apps & Services Using Guice, Hibernate, Jersey and Vaadin PostgreSQL Java Web Container JDBC Connection Google Guice Hibernate ORM App Business Logic … ... HTML5/CSS3/JavascriptHTTP XML/JSON
  • 5. Vaadin: Java Web UI Framework Architecture ServerBrowser GWT SQL Container View Presenter Application Service Application Vaadin Platform Server-side Components Terminal Adapter Client-side Engine Data BindingCRUD
  • 6. Vaadin: Java Web UI Framework Advanced Web UI with Rich UI Components (1)
  • 7. Vaadin: Java Web UI Framework Advanced Web UI with Rich UI Components (2)
  • 8. Building RESTful Web Services with Jersey (JAX-RS) (From: http://jersey.java.net)
  • 9. Hibernate ORM with Back-end PostgreSQL DB Hibernate is an object-relational mapping (ORM) library for the Java language, providing a framework for mapping an object-oriented domain model to a traditional relational database. Hibernate solves object-relational impedance mismatch problems by replacing direct persistence-related database accesses with high-level object handling functions. “Open Session in View” is a well-known design pattern to integrate Java Web/Service Tier with Hibernate ORM for CRUD operations; and will be used in both Web UI Interaction and Service Request Processing.
  • 10. Glue everything together with Google Guice To make Hibernate, Jersey, and Vaadin seamlessly working together in Java Middle-tier Container, we are using Google Guice to “glue” everything together. Google Guice is a light-weight Dependency Injection Framework, its runtime libraries are less than 1M. Guice organizes Java Object Graph through its Module and Binding, Guice's servlet extensions provide Dependency Injection in Web Application and Servlet Container, including configuration of your servlet and filter components. Through Guice Filter and Guice ServletModule, Jersey and Vaadin can be setup and configured in a Servlet Container, such as Tomcat, working nicely with Hibernate “Open Session in View” Pattern.
  • 11. A Proof-of-Concept Demo Project at github.com As proof of concept, a sample guice-hibernate-jersey-vaadin-cloudapp project is created at github.com: https://github.com/jianwu-github/guice-hbn-jersey-vaadin-cloudapp This demo project has: 1. A simple PostgreSQL DB with “subscriber” table 2. Hibernate Mapping is used to map Subscriber Class to “subscriber” table 3. A simple “Subscriber Web UI” is built on top of Vaadin 7 utilizing HbnContainer Add-on, it can be accessed at “http://localhost:8080/[appName]/ui/” when running on a local Tomcat Server. 4. A simple “Subscriber” REST Service is built on top of Jersey 1.18, it can be accessed at “http://localhost:8080/[appName]/rest/subscriber/” when running on a local Tomcat Server. 5. All the components are wired together through Guice 3.0 with ServletModule. 6. The project is built with Maven

×