SlideShare une entreprise Scribd logo
1  sur  11
A Simple Open Source Java Cloud App Stack with
Google Guice, Hibernate, Jersey and Vaadin
Jian Wu
03/09/2014
History of Web Frameworks
(Adopted from Matt Raible http://raibledesigins.com)
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)
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
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
Vaadin: Java Web UI Framework
Advanced Web UI with Rich UI Components (1)
Vaadin: Java Web UI Framework
Advanced Web UI with Rich UI Components (2)
Building RESTful Web Services
with Jersey (JAX-RS)
(From: http://jersey.java.net)
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.
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.
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

Contenu connexe

Tendances

Tendances (20)

d2iq, d2iq konvoy, day 2 operations, lifecycle management, mayadata, mayadata...
d2iq, d2iq konvoy, day 2 operations, lifecycle management, mayadata, mayadata...d2iq, d2iq konvoy, day 2 operations, lifecycle management, mayadata, mayadata...
d2iq, d2iq konvoy, day 2 operations, lifecycle management, mayadata, mayadata...
 
How to develop a mobile app for events and conferences with little to no reso...
How to develop a mobile app for events and conferences with little to no reso...How to develop a mobile app for events and conferences with little to no reso...
How to develop a mobile app for events and conferences with little to no reso...
 
KubeCon + CloudNativeCon Barcelona and Shanghai 2019 - Highlights
KubeCon + CloudNativeCon Barcelona and Shanghai 2019 - HighlightsKubeCon + CloudNativeCon Barcelona and Shanghai 2019 - Highlights
KubeCon + CloudNativeCon Barcelona and Shanghai 2019 - Highlights
 
Google Cloud Platform Intro to Data and Storage Services
Google Cloud Platform Intro to Data and Storage ServicesGoogle Cloud Platform Intro to Data and Storage Services
Google Cloud Platform Intro to Data and Storage Services
 
MICRO-FRONTEND - WEB COMPONENT APPROACH
MICRO-FRONTEND - WEB COMPONENT APPROACHMICRO-FRONTEND - WEB COMPONENT APPROACH
MICRO-FRONTEND - WEB COMPONENT APPROACH
 
Kubera Launch Webinar: Kubernetes native management of Kubernetes native data
Kubera Launch Webinar: Kubernetes native management of Kubernetes native dataKubera Launch Webinar: Kubernetes native management of Kubernetes native data
Kubera Launch Webinar: Kubernetes native management of Kubernetes native data
 
Google Anthos - Azure Stack - AWS Outposts :Comparison
Google Anthos - Azure Stack - AWS Outposts :ComparisonGoogle Anthos - Azure Stack - AWS Outposts :Comparison
Google Anthos - Azure Stack - AWS Outposts :Comparison
 
MongoDB .local Munich 2019: Telediagnosis@Daimler powered by MongoDB
MongoDB .local Munich 2019: Telediagnosis@Daimler powered by MongoDBMongoDB .local Munich 2019: Telediagnosis@Daimler powered by MongoDB
MongoDB .local Munich 2019: Telediagnosis@Daimler powered by MongoDB
 
Google App Engine At A Glance
Google App Engine At A GlanceGoogle App Engine At A Glance
Google App Engine At A Glance
 
Scality Holberton Interview Training
Scality Holberton Interview TrainingScality Holberton Interview Training
Scality Holberton Interview Training
 
Cloud Native Use Cases / Case Studies - KubeCon 2019 San Diego - RECAP
Cloud Native Use Cases / Case Studies - KubeCon 2019 San Diego - RECAPCloud Native Use Cases / Case Studies - KubeCon 2019 San Diego - RECAP
Cloud Native Use Cases / Case Studies - KubeCon 2019 San Diego - RECAP
 
S3 Server Hackathon Presented by S3 Server, a Scality Product, Seagate and Ho...
S3 Server Hackathon Presented by S3 Server, a Scality Product, Seagate and Ho...S3 Server Hackathon Presented by S3 Server, a Scality Product, Seagate and Ho...
S3 Server Hackathon Presented by S3 Server, a Scality Product, Seagate and Ho...
 
WSO2Con ASIA 2016: WSO2 Cloud Strategy Update
WSO2Con ASIA 2016: WSO2 Cloud Strategy UpdateWSO2Con ASIA 2016: WSO2 Cloud Strategy Update
WSO2Con ASIA 2016: WSO2 Cloud Strategy Update
 
micro services architecture (FrosCon2014)
micro services architecture (FrosCon2014)micro services architecture (FrosCon2014)
micro services architecture (FrosCon2014)
 
Episode 4: Operating Kubernetes at Scale with DC/OS
Episode 4: Operating Kubernetes at Scale with DC/OSEpisode 4: Operating Kubernetes at Scale with DC/OS
Episode 4: Operating Kubernetes at Scale with DC/OS
 
AMIS Oracle OpenWorld 2013 Review Part 4- SAAS Miscellaneous and Summary
AMIS Oracle OpenWorld 2013 Review Part 4- SAAS Miscellaneous and SummaryAMIS Oracle OpenWorld 2013 Review Part 4- SAAS Miscellaneous and Summary
AMIS Oracle OpenWorld 2013 Review Part 4- SAAS Miscellaneous and Summary
 
Cloud management portal - admin view
Cloud management portal - admin viewCloud management portal - admin view
Cloud management portal - admin view
 
Best Practices for Managing Kubernetes and Stateful Services: Mesosphere & Sy...
Best Practices for Managing Kubernetes and Stateful Services: Mesosphere & Sy...Best Practices for Managing Kubernetes and Stateful Services: Mesosphere & Sy...
Best Practices for Managing Kubernetes and Stateful Services: Mesosphere & Sy...
 
Deploy, move and manage Postgres across cloud platforms
Deploy, move and manage Postgres across cloud platformsDeploy, move and manage Postgres across cloud platforms
Deploy, move and manage Postgres across cloud platforms
 
Episode 1: Building Kubernetes-as-a-Service
Episode 1: Building Kubernetes-as-a-ServiceEpisode 1: Building Kubernetes-as-a-Service
Episode 1: Building Kubernetes-as-a-Service
 

En vedette

En vedette (10)

From Second Screen Social App to Continuous Multi-Screen Experience
From Second Screen Social App to Continuous Multi-Screen ExperienceFrom Second Screen Social App to Continuous Multi-Screen Experience
From Second Screen Social App to Continuous Multi-Screen Experience
 
Vaadin7 coding ui components
Vaadin7   coding ui componentsVaadin7   coding ui components
Vaadin7 coding ui components
 
Play framework 2 : Peter Hilton
Play framework 2 : Peter HiltonPlay framework 2 : Peter Hilton
Play framework 2 : Peter Hilton
 
Play Framework workshop: full stack java web app
Play Framework workshop: full stack java web appPlay Framework workshop: full stack java web app
Play Framework workshop: full stack java web app
 
Computing with Affective Lexicons: Computational Linguistics Tutorial with Da...
Computing with Affective Lexicons: Computational Linguistics Tutorial with Da...Computing with Affective Lexicons: Computational Linguistics Tutorial with Da...
Computing with Affective Lexicons: Computational Linguistics Tutorial with Da...
 
Osgi based cloud system architecture - Open Cloud Engine
Osgi based cloud system architecture - Open Cloud EngineOsgi based cloud system architecture - Open Cloud Engine
Osgi based cloud system architecture - Open Cloud Engine
 
Kubernetes Webinar Series - Understanding Service Discovery
Kubernetes Webinar Series - Understanding Service DiscoveryKubernetes Webinar Series - Understanding Service Discovery
Kubernetes Webinar Series - Understanding Service Discovery
 
'Cloud-Native' Ecosystem - Aug 2015
'Cloud-Native' Ecosystem - Aug 2015'Cloud-Native' Ecosystem - Aug 2015
'Cloud-Native' Ecosystem - Aug 2015
 
The Cloud Native Stack
The Cloud Native StackThe Cloud Native Stack
The Cloud Native Stack
 
Kubernetes dealing with storage and persistence
Kubernetes  dealing with storage and persistenceKubernetes  dealing with storage and persistence
Kubernetes dealing with storage and persistence
 

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

Wso2 product release webinar introducing jaggery
Wso2 product release webinar   introducing jaggeryWso2 product release webinar   introducing jaggery
Wso2 product release webinar introducing jaggery
WSO2
 

Similaire à Simple Open Source Java Cloud App Stack with Guice, Hibernate, Jersey and Vaadin (20)

Dirigible powered by Orion for Cloud Development (EclipseCon EU 2015)
Dirigible powered by Orion for Cloud Development (EclipseCon EU 2015)Dirigible powered by Orion for Cloud Development (EclipseCon EU 2015)
Dirigible powered by Orion for Cloud Development (EclipseCon EU 2015)
 
Wso2 product release webinar introducing jaggery
Wso2 product release webinar   introducing jaggeryWso2 product release webinar   introducing jaggery
Wso2 product release webinar introducing jaggery
 
App Service Web
App Service WebApp Service Web
App Service Web
 
Java Web Programming Using Cloud Platform: Module 10
Java Web Programming Using Cloud Platform: Module 10Java Web Programming Using Cloud Platform: Module 10
Java Web Programming Using Cloud Platform: Module 10
 
Deploying applications to Cloud with Google App Engine
Deploying applications to Cloud with Google App EngineDeploying applications to Cloud with Google App Engine
Deploying applications to Cloud with Google App Engine
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music store
 
Vijay Oscon
Vijay OsconVijay Oscon
Vijay Oscon
 
Java Development Company | Xicom
Java Development Company | XicomJava Development Company | Xicom
Java Development Company | Xicom
 
Asp.net Vs Vue.js.pdf
Asp.net Vs Vue.js.pdfAsp.net Vs Vue.js.pdf
Asp.net Vs Vue.js.pdf
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015
 
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud EnvironmentsTools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
 
Building your own calendly using amazon app sync
Building your own calendly using amazon app syncBuilding your own calendly using amazon app sync
Building your own calendly using amazon app sync
 
Building reusable components as micro frontends with glimmer js and webcompo...
Building reusable components as micro frontends  with glimmer js and webcompo...Building reusable components as micro frontends  with glimmer js and webcompo...
Building reusable components as micro frontends with glimmer js and webcompo...
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
NetWeaver Gateway- Gateway Service Consumption
NetWeaver Gateway- Gateway Service ConsumptionNetWeaver Gateway- Gateway Service Consumption
NetWeaver Gateway- Gateway Service Consumption
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speechVue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
 
Top 10 PWA Frameworks in 2020
Top 10 PWA Frameworks in 2020Top 10 PWA Frameworks in 2020
Top 10 PWA Frameworks in 2020
 
Gwt Presentation1
Gwt Presentation1Gwt Presentation1
Gwt Presentation1
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
 

Dernier

Dernier (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

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

  • 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