SlideShare a Scribd company logo
1 of 52
Download to read offline
Modern 
Web 
Applica0on 
Development 
with 
Java 
EE 
7 
By 
Shekhar 
Gula0 
Software Development Done Right 
1
Who 
am 
I 
– 
Shekhar 
Gula0 
Software Development Done Right 
• Currently 
working 
@ 
Xebia 
• Polyglot 
programmer 
• Previously 
OpenShiG 
Evangelist 
@ 
Red 
Hat 
• Author 
of 
OpenShiG 
Cookbook 
• TwiLer 
handle 
@ 
shekhargula0 
2
Agenda 
Software Development Done Right 
• Showcase 
miles2run 
• Defining 
modern 
web 
applica0on 
• How 
we 
built 
this 
applica0on 
using 
Java 
EE 
7 
– GeOng 
started 
with 
Java 
EE 
7 
– Technology 
Stack 
– Cloud 
deployment 
op0ons 
– Java 
EE 
7 
limita0ons 
and 
challenges 
• Going 
polyglot 
persistence 
3
How 
it 
all 
started? 
Software Development Done Right 
• A 
cool 
Java 
EE 
7 
demo 
applica0on 
• A 
Java 
EE 
7 
app 
that 
would 
allow 
users 
to 
store 
their 
running 
ac0vi0es 
• It 
should 
run 
on 
OpenShiG 
• It 
should 
use 
modern 
technologies 
• It 
should 
look 
and 
feel 
modern 
• It 
should 
be 
open 
source 
4
PetStore 
or 
CargoTracker 
are 
not 
modern 
real 
applica0ons 
Software Development Done Right 
5
Software Development Done Right 
6 
https://github.com/miles2run/miles2run
7 Modern Java Web Application 
Software Development Done Right
Software Development Done Right 
8
What 
makes 
a 
modern 
web 
applica0on? 
Software Development Done Right 
• Exposes 
REST 
JSON 
web 
services 
• Embraces 
HTML 
5 
• Single 
page 
web 
applica0on 
• Stateless 
so 
that 
you 
can 
scale 
horizontally 
• Uses 
Oauth 
• Embraces 
Polyglot 
Persistence 
• Responsive 
• Cloud 
aware 
• Social
Some 
op0ons 
in 
Java 
world 
Software Development Done Right 
10
Building 
Miles2Run 
– 
Ini0al 
Requirements 
Software Development Done Right 
• Applica0on 
that 
can 
store 
daily 
running 
ac0vi0es 
• Authen0ca0on 
using 
TwiLer 
• Responsive 
web 
applica0on 
• Each 
user 
should 
have 
a 
public 
profile 
11
Technology 
Stack 
Software Development Done Right 
• Java 
EE 
7 
with 
JDK 
7 
– JPA, 
EJB, 
CDI, 
JAX-­‐RS 
• SLF4J 
• MySQL 
• AngularJS 
• TwiLer 
Bootstrap 
• WildFly 
on 
OpenShiG 
12
Java 
EE 
7 
Software Development Done Right 
• Standards 
based 
development 
• Portability 
across 
applica0on 
servers 
• Lightweight 
deployment 
• Easy 
to 
get 
started 
• Java 
EE 
API 
provides 
a 
good 
star0ng 
point 
– CDI, 
JAX-­‐RS, 
JPA 
are 
at 
the 
heart 
of 
any 
modern 
web 
applica0on 
13
Java 
EE 
7 
Software Development Done Right 
14
LOOK 
AT 
FEW 
JAVA 
EE 
API 
Software Development Done Right 
15
CDI 
1.1-­‐-­‐ 
Context 
and 
Dependency 
Injec0on 
• Allows 
you 
to 
use 
dependency 
injec0on 
in 
Java 
EE 
environment 
without 
third 
party 
libraries. 
Software Development Done Right 
• Don’t 
call 
us. 
We 
will 
call 
you. 
• CDI 
container 
manages 
the 
life 
cycle 
of 
components. 
• CDI 
brings 
dependency 
injec0on, 
context 
and 
scopes, 
interceptors, 
loose 
coupling 
and 
strong 
typing. 
• Injected 
bean 
lifecycle 
depends 
on 
the 
target 
bean. 
• Turns 
nearly 
every 
Java 
class 
into 
CDI 
bean 
• It 
is 
not 
a 
non 
sta0c 
inner 
class 
• It 
is 
a 
concrete 
class 
or 
annotated 
with 
decorators 
• Has 
default 
constructor 
with 
no 
parameters 
or 
declares 
a 
constructor 
with 
@Inject
CDI 
1.1: 
What’s 
new 
in 
Java 
EE 
7? 
Software Development Done Right 
• Finer 
scanning 
control 
in 
beans.xml 
• bean-­‐discovery-­‐mode 
aLribute 
– 
all, 
none, 
annotated 
• @Vetoed 
annota0on 
to 
veto 
processing 
of 
a 
package 
or 
class. 
• You 
can 
use 
@Transac0onal 
with 
CDI 
beans. 
• You 
can 
get 
away 
from 
EJBs.
JPA 
Software Development Done Right 
• Describes 
the 
management 
of 
rela0onal 
data 
in 
applica0ons. 
• JPA 
implementa0ons 
provide 
ORM 
framework 
• JPA 
provides 
an 
API 
to 
perform 
CRUD 
and 
find 
opera0ons 
on 
en00es. 
• An 
en0ty 
is 
a 
POJO, 
whose 
state 
is 
mapped 
to 
a 
rela0onal 
database 
table. 
• JPA 
also 
provides 
a 
query 
language 
to 
make 
queries 
against 
en00es 
stored 
in 
rela0onal 
database.
JPA 
2.1 
– 
What’s 
new 
in 
Java 
EE 
7? 
Software Development Done Right 
• Schema 
genera0on 
using 
standard 
proper0es. 
• Use 
@Index 
to 
define 
addi0onal 
indexes 
in 
schema 
genera0on. 
• New 
En0tyGraph 
API 
available 
in 
En0tyManager.
Storing 
data 
in 
UTC 
Software Development Done Right 
• Store 
all 
the 
dates 
in 
the 
UTC 
format 
and 
then 
depending 
on 
the 
client 
0mezone 
show 
it 
to 
the 
user 
20
Bean 
Valida0on 
Software Development Done Right 
• Specifies 
common 
valida0on 
concept 
for 
JavaBeans. 
• Allow 
you 
to 
put 
constraints 
on 
data 
to 
make 
sure 
it 
is 
valid. 
• Annota0on 
based 
constraints 
• Use 
constraint 
in 
any 
layer
Bean 
Valida0on 
Example 
public 
class 
Status{ 
@NotNull 
@Size(max 
= 
140) 
private 
String 
message; 
@NotNull 
@Past 
private 
final 
Date 
postedAt; 
@UniqueUrl 
private 
String 
url; 
public 
Status() 
{} 
} 
Software Development Done Right
Bean 
Valida0on 
1.1 
– 
What’s 
new 
in 
Java 
EE 
7? 
Software Development Done Right 
• Approaches 
Programming 
by 
Contract 
• Can 
inject 
with 
CDI 
into 
Validator 
implementa0ons 
• Integra0on 
with 
JAX-­‐RS 
@Path(“/statuses”) 
public class StatusService { 
@POST @Produces(“application/json”) 
public @NotNull Status postStatus(@Valid @NotNull Status status) { 
// persist in database 
return status; 
} 
}
JAX-­‐RS 
Software Development Done Right 
• Java 
API 
for 
RESTful 
web 
services 
• Annota0on 
driven 
API 
that 
aims 
to 
help 
developers 
build 
RESTful 
web 
services 
in 
Java 
• POJO 
based 
Resource 
classes 
• HTTP 
centric 
– Maps 
HTTP 
requests 
to 
Java 
method 
invoca0ons 
24
JAX-­‐RS 
Resource 
Software Development Done Right 
25
What’s 
new 
in 
Java 
EE 
7? 
Software Development Done Right 
• Client 
API 
• Asynchronous 
JAX-­‐RS 
services 
• Filters 
and 
interceptors 
26
SLF4J 
Software Development Done Right 
• Abstrac0on 
or 
façade 
on 
top 
of 
different 
logging 
API 
• SLF4J 
with 
Logback 
provides 
a 
faster 
logging 
implementa0on 
• SLF4J 
has 
great 
paLern 
subs0tu0on 
support. 
logger.debug("Calcula0ng 
Goal-­‐{} 
progress 
between 
{} 
and 
{}", 
goalId, 
startDate, 
endDate); 
27
AngularJS 
Software Development Done Right 
• Extends 
HTML 
to 
add 
dynamic 
nature 
so 
that 
we 
can 
build 
modern 
web 
applica0ons 
with 
ease 
• Declara0ve 
approach 
• Eliminates 
DOM 
manipula0on 
by 
two 
way 
data 
binding 
• Ideal 
for 
building 
single 
page 
web 
applica0ons 
28
AngularJS 
in 
Ac0on 
Software Development Done Right 
29
OpenShift 
is 
PaaS by Red Hat 
Multi-language, 
Auto-Scaling, 
Self-service, 
Elastic, 
Cloud Application Platform 
Software Development Done Right
CLOUD COMPUTING 101 
APPLICATION 
APPLICATION PLATFORM 
(App Server, Middleware, Languages) 
OPERATING SYSTEM 
VIRTUAL GUEST IMAGES 
COMPUTE RESOURCES 
(CPU, RAM, NETWORK, DISK) 
Automated and Managed by 
the Cloud Provider 
Software Development Done Right 
Provided and Controlled by 
Cloud Consumer 
IaaS PaaS SaaS 
Increased Control 
Increased Automation 
DEVELOPER TOOLING 
(IDE, Source Control, Build Tools, CI)
Why 
OpenShiZ? 
l Focus 
on 
code, 
not 
on 
configura0on 
l Speeds 
up 
deployment 
l Scales 
your 
app 
Software Development Done Right 
l Efficient 
l Embraces 
polyglot 
programming 
and 
persistence.
Bringing 
everything 
together 
Software Development Done Right 
• Start 
by 
crea0ng 
WildFly 
app 
on 
OpenShiG 
• OpenShiG 
will 
create 
a 
Maven 
app 
• Clone 
the 
app 
Git 
repo 
on 
your 
local 
machine 
• Import 
the 
app 
in 
your 
favorite 
IDE 
• Write 
domain 
model 
• Write 
EJB 
services 
that 
uses 
JPA 
en0ty 
manager 
• Expose 
REST 
API 
• Commit 
the 
code 
to 
local 
repo 
and 
push 
changes 
to 
remote 
Git 
repository 
33
Challenges 
Software Development Done Right 
• Rendering 
HTML 
5 
pages 
from 
JAX-­‐RS 
• Use 
JAX-­‐RS 
as 
MVC 
framework 
• Servlet 
containers 
do 
not 
create 
sessions 
when 
you 
render 
HTML 
5 
pages 
• Your 
whole 
applica0on 
is 
not 
a 
single 
SPA 
• Java 
EE 
has 
no 
support 
for 
OAuth 
providers 
like 
TwiLer 
34
To 
overcome 
some 
of 
these 
challenges 
I 
wrote 
a 
small 
framework 
called 
JUG 
hLps://github.com/miles2run/jug 
It 
allows 
me 
to 
render 
HTML 
5 
pages 
using 
Thymeleaf 
template 
engine 
Provides 
basic 
security 
check 
Enables 
sessions 
for 
HTML 
5 
pages 
Software Development Done Right 
35
JUG 
Example 
Software Development Done Right 
36
Why 
Thymeleaf? 
Software Development Done Right 
• Thymeleaf 
documents 
are 
valid 
HTML 
5 
documents 
so 
you 
can 
work 
with 
them 
offline 
• Extends 
HTML 
by 
a 
tag 
library 
• All 
thymeleaf 
documents 
are 
valid 
HTML 
5 
documents 
• Allows 
designers 
and 
developers 
to 
work 
together 
37 
createProfile.html
Make 
app 
social 
– 
new 
requirements 
• Ability 
to 
follow 
other 
users 
Software Development Done Right 
• View 
their 
ac0vi0es 
on 
my 
home 
page 
38
Redis 
to 
rescue 
Software Development Done Right 
• REmote 
DIc0onary 
Server 
• Redis 
is 
an 
in-­‐memory 
key 
value 
data 
store 
• Supports 
persistence 
• Supports 
rich 
set 
of 
data 
types 
– List, 
Set, 
Sorted 
Set, 
Hash 
39
Redis 
Set 
for 
storing 
follower 
and 
following 
Software Development Done Right 
40
Redis 
update 
0meline 
with 
follower 
0meline 
Software Development Done Right 
41 
TimelineRepository.java
Redis 
– 
Storing 
Ac0vi0es 
Software Development Done Right 
42 
TimelineRepository.java
Other 
use 
case 
of 
Redis 
Software Development Done Right 
• Maintaining 
applica0on 
counters 
• Latest 
ac0vi0es 
on 
user 
home 
page 
• Caching 
ac0vi0es 
43
Sugges0ng 
users 
– 
another 
requirement 
Software Development Done Right 
• Sugges0ng 
users 
based 
on 
loca0on 
44
MongoDB 
to 
rescue 
Software Development Done Right 
45
Storing 
GeoSpa0al 
data 
Software Development Done Right 
46
Querying 
data 
Software Development Done Right 
47
Loca0onBasedUserSuggester 
Software Development Done Right 
48
Adding 
beau0ful 
graphs 
Software Development Done Right 
• C3.js 
for 
crea0ng 
graphs 
• Provides 
API 
to 
write 
D3 
based 
charts 
• No 
need 
to 
work 
with 
D3 
API 
• Examples 
hLp://c3js.org/examples.html 
49
Genera0ng 
a 
Donut 
chart 
Software Development Done Right 
50
Configuring 
error 
pages 
Software Development Done Right 
51
THANKS 
Q 
& 
A 
Software Development Done Right 
52

More Related Content

What's hot

HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015Edward Burns
 
EJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyEJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyDavid Delabassee
 
Finally, EE Security API JSR 375
Finally, EE Security API JSR 375Finally, EE Security API JSR 375
Finally, EE Security API JSR 375Alex Kosowski
 
Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot David Delabassee
 
Reactive Java EE - Let Me Count the Ways!
Reactive Java EE - Let Me Count the Ways!Reactive Java EE - Let Me Count the Ways!
Reactive Java EE - Let Me Count the Ways!Reza Rahman
 
Down-to-Earth Microservices with Java EE
Down-to-Earth Microservices with Java EEDown-to-Earth Microservices with Java EE
Down-to-Earth Microservices with Java EEReza Rahman
 
Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]Ryan Cuprak
 
JavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great MatchJavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great MatchReza Rahman
 
What's Coming in Java EE 8
What's Coming in Java EE 8What's Coming in Java EE 8
What's Coming in Java EE 8PT.JUG
 
MicroProfile for MicroServices
MicroProfile for MicroServicesMicroProfile for MicroServices
MicroProfile for MicroServicesMert Çalışkan
 
Java API for JSON Binding - Introduction and update
Java API for JSON Binding - Introduction and updateJava API for JSON Binding - Introduction and update
Java API for JSON Binding - Introduction and updateMartin Grebac
 
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0David Delabassee
 
Burns jsf-confess-2015
Burns jsf-confess-2015Burns jsf-confess-2015
Burns jsf-confess-2015Edward Burns
 

What's hot (16)

MVC 1.0 / JSR 371
MVC 1.0 / JSR 371MVC 1.0 / JSR 371
MVC 1.0 / JSR 371
 
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015
 
EJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyEJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and Strategy
 
Finally, EE Security API JSR 375
Finally, EE Security API JSR 375Finally, EE Security API JSR 375
Finally, EE Security API JSR 375
 
Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot
 
Reactive Java EE - Let Me Count the Ways!
Reactive Java EE - Let Me Count the Ways!Reactive Java EE - Let Me Count the Ways!
Reactive Java EE - Let Me Count the Ways!
 
Down-to-Earth Microservices with Java EE
Down-to-Earth Microservices with Java EEDown-to-Earth Microservices with Java EE
Down-to-Earth Microservices with Java EE
 
Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]
 
JavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great MatchJavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great Match
 
Java on Azure
Java on AzureJava on Azure
Java on Azure
 
What's Coming in Java EE 8
What's Coming in Java EE 8What's Coming in Java EE 8
What's Coming in Java EE 8
 
JavaCro'15 - Java EE 8 - An instant snapshot - David Delabassee
JavaCro'15 - Java EE 8 - An instant snapshot - David DelabasseeJavaCro'15 - Java EE 8 - An instant snapshot - David Delabassee
JavaCro'15 - Java EE 8 - An instant snapshot - David Delabassee
 
MicroProfile for MicroServices
MicroProfile for MicroServicesMicroProfile for MicroServices
MicroProfile for MicroServices
 
Java API for JSON Binding - Introduction and update
Java API for JSON Binding - Introduction and updateJava API for JSON Binding - Introduction and update
Java API for JSON Binding - Introduction and update
 
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
 
Burns jsf-confess-2015
Burns jsf-confess-2015Burns jsf-confess-2015
Burns jsf-confess-2015
 

Similar to Modern Java EE 7 Web App with AngularJS, Redis, MongoDB

Developing Java Microservices Fast with Open Liberty
Developing Java Microservices Fast with Open LibertyDeveloping Java Microservices Fast with Open Liberty
Developing Java Microservices Fast with Open LibertyYK Chang
 
Neev Open Source Contributions
Neev Open Source ContributionsNeev Open Source Contributions
Neev Open Source ContributionsNeev Technologies
 
01/2009 - Portral development with liferay
01/2009 - Portral development with liferay01/2009 - Portral development with liferay
01/2009 - Portral development with liferaydaveayan
 
Modern application development with oracle cloud sangam17
Modern application development with oracle cloud sangam17Modern application development with oracle cloud sangam17
Modern application development with oracle cloud sangam17Vinay Kumar
 
JDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKJDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKWolfgang Weigend
 
Prominent Back-end frameworks to consider in 2022!
Prominent Back-end frameworks to consider in 2022!Prominent Back-end frameworks to consider in 2022!
Prominent Back-end frameworks to consider in 2022!Shelly Megan
 
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 EnvironmentsVMware Tanzu
 
Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Arun Gupta
 
JCON_15FactorWorkshop.pptx
JCON_15FactorWorkshop.pptxJCON_15FactorWorkshop.pptx
JCON_15FactorWorkshop.pptxGrace Jansen
 
Bala Sr Java Developer
Bala  Sr Java DeveloperBala  Sr Java Developer
Bala Sr Java DeveloperJava Dev
 
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014Arun Gupta
 
Introduction To Web Development & The New Digital Workplace
Introduction To Web Development & The New Digital WorkplaceIntroduction To Web Development & The New Digital Workplace
Introduction To Web Development & The New Digital WorkplaceJen Wei Lee
 
Project report for final year project
Project report for final year projectProject report for final year project
Project report for final year projectsuneel singh
 
Drupal 8 introduction
Drupal 8 introductionDrupal 8 introduction
Drupal 8 introductionAditya Ghan
 
5 Treding Java Frameworks Offshore Developers Should About
5 Treding Java Frameworks Offshore Developers Should About5 Treding Java Frameworks Offshore Developers Should About
5 Treding Java Frameworks Offshore Developers Should AboutBJIT Ltd
 
whats-new-netbeans-ide-7x.pptx
whats-new-netbeans-ide-7x.pptxwhats-new-netbeans-ide-7x.pptx
whats-new-netbeans-ide-7x.pptxGabrielSoche
 
005528214.pdf
005528214.pdf005528214.pdf
005528214.pdfEidTahir
 
MySQL Shell: The DevOps Tool for MySQL
MySQL Shell: The DevOps Tool for MySQLMySQL Shell: The DevOps Tool for MySQL
MySQL Shell: The DevOps Tool for MySQLMiguel Araújo
 
Busy developer-html5-javaee7
Busy developer-html5-javaee7Busy developer-html5-javaee7
Busy developer-html5-javaee7Geertjan Wielenga
 
Ananth_Ravishankar
Ananth_RavishankarAnanth_Ravishankar
Ananth_Ravishankarananth R
 

Similar to Modern Java EE 7 Web App with AngularJS, Redis, MongoDB (20)

Developing Java Microservices Fast with Open Liberty
Developing Java Microservices Fast with Open LibertyDeveloping Java Microservices Fast with Open Liberty
Developing Java Microservices Fast with Open Liberty
 
Neev Open Source Contributions
Neev Open Source ContributionsNeev Open Source Contributions
Neev Open Source Contributions
 
01/2009 - Portral development with liferay
01/2009 - Portral development with liferay01/2009 - Portral development with liferay
01/2009 - Portral development with liferay
 
Modern application development with oracle cloud sangam17
Modern application development with oracle cloud sangam17Modern application development with oracle cloud sangam17
Modern application development with oracle cloud sangam17
 
JDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKJDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDK
 
Prominent Back-end frameworks to consider in 2022!
Prominent Back-end frameworks to consider in 2022!Prominent Back-end frameworks to consider in 2022!
Prominent Back-end frameworks to consider in 2022!
 
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
 
Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014
 
JCON_15FactorWorkshop.pptx
JCON_15FactorWorkshop.pptxJCON_15FactorWorkshop.pptx
JCON_15FactorWorkshop.pptx
 
Bala Sr Java Developer
Bala  Sr Java DeveloperBala  Sr Java Developer
Bala Sr Java Developer
 
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
 
Introduction To Web Development & The New Digital Workplace
Introduction To Web Development & The New Digital WorkplaceIntroduction To Web Development & The New Digital Workplace
Introduction To Web Development & The New Digital Workplace
 
Project report for final year project
Project report for final year projectProject report for final year project
Project report for final year project
 
Drupal 8 introduction
Drupal 8 introductionDrupal 8 introduction
Drupal 8 introduction
 
5 Treding Java Frameworks Offshore Developers Should About
5 Treding Java Frameworks Offshore Developers Should About5 Treding Java Frameworks Offshore Developers Should About
5 Treding Java Frameworks Offshore Developers Should About
 
whats-new-netbeans-ide-7x.pptx
whats-new-netbeans-ide-7x.pptxwhats-new-netbeans-ide-7x.pptx
whats-new-netbeans-ide-7x.pptx
 
005528214.pdf
005528214.pdf005528214.pdf
005528214.pdf
 
MySQL Shell: The DevOps Tool for MySQL
MySQL Shell: The DevOps Tool for MySQLMySQL Shell: The DevOps Tool for MySQL
MySQL Shell: The DevOps Tool for MySQL
 
Busy developer-html5-javaee7
Busy developer-html5-javaee7Busy developer-html5-javaee7
Busy developer-html5-javaee7
 
Ananth_Ravishankar
Ananth_RavishankarAnanth_Ravishankar
Ananth_Ravishankar
 

More from Shekhar Gulati

Working effectively with OpenShift
Working effectively with OpenShiftWorking effectively with OpenShift
Working effectively with OpenShiftShekhar Gulati
 
Developing Great Apps with Apache Cordova
Developing Great Apps with Apache CordovaDeveloping Great Apps with Apache Cordova
Developing Great Apps with Apache CordovaShekhar Gulati
 
Developing Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJSDeveloping Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJSShekhar Gulati
 
Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Shekhar Gulati
 
Developing modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular jsDeveloping modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular jsShekhar Gulati
 
Open shift for java(ee) developers
Open shift for java(ee) developersOpen shift for java(ee) developers
Open shift for java(ee) developersShekhar Gulati
 
Thinking beyond RDBMS - Building Polyglot Persistence Java Applications Devf...
Thinking beyond RDBMS  - Building Polyglot Persistence Java Applications Devf...Thinking beyond RDBMS  - Building Polyglot Persistence Java Applications Devf...
Thinking beyond RDBMS - Building Polyglot Persistence Java Applications Devf...Shekhar Gulati
 
Java EE 6 and NoSQL Workshop DevFest Austria
Java EE 6 and NoSQL Workshop DevFest AustriaJava EE 6 and NoSQL Workshop DevFest Austria
Java EE 6 and NoSQL Workshop DevFest AustriaShekhar Gulati
 
Power up Magnolia CMS with OpenShift
Power up Magnolia CMS with OpenShiftPower up Magnolia CMS with OpenShift
Power up Magnolia CMS with OpenShiftShekhar Gulati
 
Bringing spatial love to your python application
Bringing spatial love to your python applicationBringing spatial love to your python application
Bringing spatial love to your python applicationShekhar Gulati
 
Building spatial back ends with Node.js and MongoDB
Building spatial back ends with Node.js and MongoDBBuilding spatial back ends with Node.js and MongoDB
Building spatial back ends with Node.js and MongoDBShekhar Gulati
 
A Happy Cloud Friendly Java Developer with OpenShift
A Happy Cloud Friendly Java Developer with OpenShiftA Happy Cloud Friendly Java Developer with OpenShift
A Happy Cloud Friendly Java Developer with OpenShiftShekhar Gulati
 
Indic threads java10-spring-roo-and-the-cloud
Indic threads java10-spring-roo-and-the-cloudIndic threads java10-spring-roo-and-the-cloud
Indic threads java10-spring-roo-and-the-cloudShekhar Gulati
 

More from Shekhar Gulati (13)

Working effectively with OpenShift
Working effectively with OpenShiftWorking effectively with OpenShift
Working effectively with OpenShift
 
Developing Great Apps with Apache Cordova
Developing Great Apps with Apache CordovaDeveloping Great Apps with Apache Cordova
Developing Great Apps with Apache Cordova
 
Developing Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJSDeveloping Modern Java Web Applications with Java EE 7 and AngularJS
Developing Modern Java Web Applications with Java EE 7 and AngularJS
 
Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud
 
Developing modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular jsDeveloping modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular js
 
Open shift for java(ee) developers
Open shift for java(ee) developersOpen shift for java(ee) developers
Open shift for java(ee) developers
 
Thinking beyond RDBMS - Building Polyglot Persistence Java Applications Devf...
Thinking beyond RDBMS  - Building Polyglot Persistence Java Applications Devf...Thinking beyond RDBMS  - Building Polyglot Persistence Java Applications Devf...
Thinking beyond RDBMS - Building Polyglot Persistence Java Applications Devf...
 
Java EE 6 and NoSQL Workshop DevFest Austria
Java EE 6 and NoSQL Workshop DevFest AustriaJava EE 6 and NoSQL Workshop DevFest Austria
Java EE 6 and NoSQL Workshop DevFest Austria
 
Power up Magnolia CMS with OpenShift
Power up Magnolia CMS with OpenShiftPower up Magnolia CMS with OpenShift
Power up Magnolia CMS with OpenShift
 
Bringing spatial love to your python application
Bringing spatial love to your python applicationBringing spatial love to your python application
Bringing spatial love to your python application
 
Building spatial back ends with Node.js and MongoDB
Building spatial back ends with Node.js and MongoDBBuilding spatial back ends with Node.js and MongoDB
Building spatial back ends with Node.js and MongoDB
 
A Happy Cloud Friendly Java Developer with OpenShift
A Happy Cloud Friendly Java Developer with OpenShiftA Happy Cloud Friendly Java Developer with OpenShift
A Happy Cloud Friendly Java Developer with OpenShift
 
Indic threads java10-spring-roo-and-the-cloud
Indic threads java10-spring-roo-and-the-cloudIndic threads java10-spring-roo-and-the-cloud
Indic threads java10-spring-roo-and-the-cloud
 

Recently uploaded

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Recently uploaded (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

Modern Java EE 7 Web App with AngularJS, Redis, MongoDB

  • 1. Modern Web Applica0on Development with Java EE 7 By Shekhar Gula0 Software Development Done Right 1
  • 2. Who am I – Shekhar Gula0 Software Development Done Right • Currently working @ Xebia • Polyglot programmer • Previously OpenShiG Evangelist @ Red Hat • Author of OpenShiG Cookbook • TwiLer handle @ shekhargula0 2
  • 3. Agenda Software Development Done Right • Showcase miles2run • Defining modern web applica0on • How we built this applica0on using Java EE 7 – GeOng started with Java EE 7 – Technology Stack – Cloud deployment op0ons – Java EE 7 limita0ons and challenges • Going polyglot persistence 3
  • 4. How it all started? Software Development Done Right • A cool Java EE 7 demo applica0on • A Java EE 7 app that would allow users to store their running ac0vi0es • It should run on OpenShiG • It should use modern technologies • It should look and feel modern • It should be open source 4
  • 5. PetStore or CargoTracker are not modern real applica0ons Software Development Done Right 5
  • 6. Software Development Done Right 6 https://github.com/miles2run/miles2run
  • 7. 7 Modern Java Web Application Software Development Done Right
  • 9. What makes a modern web applica0on? Software Development Done Right • Exposes REST JSON web services • Embraces HTML 5 • Single page web applica0on • Stateless so that you can scale horizontally • Uses Oauth • Embraces Polyglot Persistence • Responsive • Cloud aware • Social
  • 10. Some op0ons in Java world Software Development Done Right 10
  • 11. Building Miles2Run – Ini0al Requirements Software Development Done Right • Applica0on that can store daily running ac0vi0es • Authen0ca0on using TwiLer • Responsive web applica0on • Each user should have a public profile 11
  • 12. Technology Stack Software Development Done Right • Java EE 7 with JDK 7 – JPA, EJB, CDI, JAX-­‐RS • SLF4J • MySQL • AngularJS • TwiLer Bootstrap • WildFly on OpenShiG 12
  • 13. Java EE 7 Software Development Done Right • Standards based development • Portability across applica0on servers • Lightweight deployment • Easy to get started • Java EE API provides a good star0ng point – CDI, JAX-­‐RS, JPA are at the heart of any modern web applica0on 13
  • 14. Java EE 7 Software Development Done Right 14
  • 15. LOOK AT FEW JAVA EE API Software Development Done Right 15
  • 16. CDI 1.1-­‐-­‐ Context and Dependency Injec0on • Allows you to use dependency injec0on in Java EE environment without third party libraries. Software Development Done Right • Don’t call us. We will call you. • CDI container manages the life cycle of components. • CDI brings dependency injec0on, context and scopes, interceptors, loose coupling and strong typing. • Injected bean lifecycle depends on the target bean. • Turns nearly every Java class into CDI bean • It is not a non sta0c inner class • It is a concrete class or annotated with decorators • Has default constructor with no parameters or declares a constructor with @Inject
  • 17. CDI 1.1: What’s new in Java EE 7? Software Development Done Right • Finer scanning control in beans.xml • bean-­‐discovery-­‐mode aLribute – all, none, annotated • @Vetoed annota0on to veto processing of a package or class. • You can use @Transac0onal with CDI beans. • You can get away from EJBs.
  • 18. JPA Software Development Done Right • Describes the management of rela0onal data in applica0ons. • JPA implementa0ons provide ORM framework • JPA provides an API to perform CRUD and find opera0ons on en00es. • An en0ty is a POJO, whose state is mapped to a rela0onal database table. • JPA also provides a query language to make queries against en00es stored in rela0onal database.
  • 19. JPA 2.1 – What’s new in Java EE 7? Software Development Done Right • Schema genera0on using standard proper0es. • Use @Index to define addi0onal indexes in schema genera0on. • New En0tyGraph API available in En0tyManager.
  • 20. Storing data in UTC Software Development Done Right • Store all the dates in the UTC format and then depending on the client 0mezone show it to the user 20
  • 21. Bean Valida0on Software Development Done Right • Specifies common valida0on concept for JavaBeans. • Allow you to put constraints on data to make sure it is valid. • Annota0on based constraints • Use constraint in any layer
  • 22. Bean Valida0on Example public class Status{ @NotNull @Size(max = 140) private String message; @NotNull @Past private final Date postedAt; @UniqueUrl private String url; public Status() {} } Software Development Done Right
  • 23. Bean Valida0on 1.1 – What’s new in Java EE 7? Software Development Done Right • Approaches Programming by Contract • Can inject with CDI into Validator implementa0ons • Integra0on with JAX-­‐RS @Path(“/statuses”) public class StatusService { @POST @Produces(“application/json”) public @NotNull Status postStatus(@Valid @NotNull Status status) { // persist in database return status; } }
  • 24. JAX-­‐RS Software Development Done Right • Java API for RESTful web services • Annota0on driven API that aims to help developers build RESTful web services in Java • POJO based Resource classes • HTTP centric – Maps HTTP requests to Java method invoca0ons 24
  • 25. JAX-­‐RS Resource Software Development Done Right 25
  • 26. What’s new in Java EE 7? Software Development Done Right • Client API • Asynchronous JAX-­‐RS services • Filters and interceptors 26
  • 27. SLF4J Software Development Done Right • Abstrac0on or façade on top of different logging API • SLF4J with Logback provides a faster logging implementa0on • SLF4J has great paLern subs0tu0on support. logger.debug("Calcula0ng Goal-­‐{} progress between {} and {}", goalId, startDate, endDate); 27
  • 28. AngularJS Software Development Done Right • Extends HTML to add dynamic nature so that we can build modern web applica0ons with ease • Declara0ve approach • Eliminates DOM manipula0on by two way data binding • Ideal for building single page web applica0ons 28
  • 29. AngularJS in Ac0on Software Development Done Right 29
  • 30. OpenShift is PaaS by Red Hat Multi-language, Auto-Scaling, Self-service, Elastic, Cloud Application Platform Software Development Done Right
  • 31. CLOUD COMPUTING 101 APPLICATION APPLICATION PLATFORM (App Server, Middleware, Languages) OPERATING SYSTEM VIRTUAL GUEST IMAGES COMPUTE RESOURCES (CPU, RAM, NETWORK, DISK) Automated and Managed by the Cloud Provider Software Development Done Right Provided and Controlled by Cloud Consumer IaaS PaaS SaaS Increased Control Increased Automation DEVELOPER TOOLING (IDE, Source Control, Build Tools, CI)
  • 32. Why OpenShiZ? l Focus on code, not on configura0on l Speeds up deployment l Scales your app Software Development Done Right l Efficient l Embraces polyglot programming and persistence.
  • 33. Bringing everything together Software Development Done Right • Start by crea0ng WildFly app on OpenShiG • OpenShiG will create a Maven app • Clone the app Git repo on your local machine • Import the app in your favorite IDE • Write domain model • Write EJB services that uses JPA en0ty manager • Expose REST API • Commit the code to local repo and push changes to remote Git repository 33
  • 34. Challenges Software Development Done Right • Rendering HTML 5 pages from JAX-­‐RS • Use JAX-­‐RS as MVC framework • Servlet containers do not create sessions when you render HTML 5 pages • Your whole applica0on is not a single SPA • Java EE has no support for OAuth providers like TwiLer 34
  • 35. To overcome some of these challenges I wrote a small framework called JUG hLps://github.com/miles2run/jug It allows me to render HTML 5 pages using Thymeleaf template engine Provides basic security check Enables sessions for HTML 5 pages Software Development Done Right 35
  • 36. JUG Example Software Development Done Right 36
  • 37. Why Thymeleaf? Software Development Done Right • Thymeleaf documents are valid HTML 5 documents so you can work with them offline • Extends HTML by a tag library • All thymeleaf documents are valid HTML 5 documents • Allows designers and developers to work together 37 createProfile.html
  • 38. Make app social – new requirements • Ability to follow other users Software Development Done Right • View their ac0vi0es on my home page 38
  • 39. Redis to rescue Software Development Done Right • REmote DIc0onary Server • Redis is an in-­‐memory key value data store • Supports persistence • Supports rich set of data types – List, Set, Sorted Set, Hash 39
  • 40. Redis Set for storing follower and following Software Development Done Right 40
  • 41. Redis update 0meline with follower 0meline Software Development Done Right 41 TimelineRepository.java
  • 42. Redis – Storing Ac0vi0es Software Development Done Right 42 TimelineRepository.java
  • 43. Other use case of Redis Software Development Done Right • Maintaining applica0on counters • Latest ac0vi0es on user home page • Caching ac0vi0es 43
  • 44. Sugges0ng users – another requirement Software Development Done Right • Sugges0ng users based on loca0on 44
  • 45. MongoDB to rescue Software Development Done Right 45
  • 46. Storing GeoSpa0al data Software Development Done Right 46
  • 47. Querying data Software Development Done Right 47
  • 49. Adding beau0ful graphs Software Development Done Right • C3.js for crea0ng graphs • Provides API to write D3 based charts • No need to work with D3 API • Examples hLp://c3js.org/examples.html 49
  • 50. Genera0ng a Donut chart Software Development Done Right 50
  • 51. Configuring error pages Software Development Done Right 51
  • 52. THANKS Q & A Software Development Done Right 52