Today the Java EE is a de-facto standard architecture for any kind of enterprise systems in the world, and realized as ease of development on its specification. But especially for the huge enterprise systems, not small or mediocre, there are still many issue for designing, developing, and operating. You can learn the overview and some details of the huge enterprise system design, with referring latest Java EE specifications on this session.
https://tech.rakuten.co.jp/
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Huge Enterprise Systems Architecture Design with Java EE
1. @HirofumiIwasaki 1
Huge Enterprise Systems Architecture Design
with Java EE
Oct 22, 2016
Hirofumi Iwasaki
Group Manager, Rakuten Card Co., Ltd.
2. @HirofumiIwasaki 2
Speaker Biography
Hirofumi Iwasaki
– Group Manager
– New System Technology Group, New System Development Department,
Rakuten Card Co., Ltd. (seconded from Rakuten, Inc.)
Carrier
– 17 Years of experience in planning, designing and implementation of
Japanese financial, manufacturing and public enterprise system with
emphasis in Java EE and .NET enterprise middleware.
Opus, Lectures, etc.
– Conferences: JavaOne 2015, 2014, Oracle OpenWorld 2014, Java Day
Tokyo 2016 - 2014, JJUG CCC Spring & Fall (2014), WebLogic roundtable
(2012-2013), Rakuten Tech Conference 2016 – 2013, etc.
– Book: デベロッパーのキャリアと働き方を語ろうVol.1 (2016)
– Magazine: 日経コンピュータ 2015年8月号 @IT (2005-2010), CIO Magazine
(2009), IT Architect (2005-2009), Web+DB Press (2005), Java World
(2001-2004), etc.
3. @HirofumiIwasaki 3
Agenda
1. Enterprise Systems and its Features
2. Java EE Specifications for Enterprise Systems
3. Java EE Applying Points for Real Enterprise Systems
a) Start Application Design with Java EE
b) Specify IDE for Modern Development Style
c) Web Front-End with JSF
d) Business Logic with EJB or CDI
e) Data Access with JPA
f) Connectivity with RMI-IIOP, REST and WebSocket
4. @HirofumiIwasaki 4
About the Enterprise Systems
Enterprise systems (ES) are large-scale application software
packages that support business processes, information flows,
reporting, and data analytics in complex organizations.
-(from Wikipedia "Enterprise Systems")
5. @HirofumiIwasaki 5
Enterprise Software on Enterprise Systems
Enterprise software, also known as enterprise application
software (EAS), is computer software used to satisfy the needs
of an organization rather than individual users. Such
organizations would include businesses, schools, interest-based
user groups, clubs, charities, or governments.[1] Enterprise
software is an integral part of a (computer-based) information
system.
Enterprise
Systems
Enterprise
Software
6. @HirofumiIwasaki 6
Non-Functional Requirements of Enterprise Software
Enterprise Software
ACID Transaction Management
Distributed
Transaction
Management
Efficient Database
& MQ Connectivity
Variety of
Communication
Protocols
Frameworks of
Web Systems and
Mobile Apps
Efficient
Development
Environment
Security
Management, etc.
7. @HirofumiIwasaki 7
Custom? or Packaged? on Enterprise Systems
Packaging Software
Approach
Custom Software
Approach
For strong area of the
enterprise.
Specialties of the
competitiveness,
depends on each
industries.
For non strong area of
the enterprise.
E.g. HR, accounting,
information sharing
systems, etc.
8. @HirofumiIwasaki 8
Custom? or Packaged? on Enterprise Systems
Packaging Software
Approach
Custom Software
Approach
For strong area of the
enterprise.
Specialties of the
competitiveness,
depends on each
industries.
For non strong area of
the enterprise.
E.g. HR, accounting,
information sharing
systems, etc.
9. @HirofumiIwasaki 9
For Start Making Custom Enterprise Software
Maturity for Huge Mission Critical Systems
OpenStandard,CommunityPower
Microsoft .NET
Framework
Java EE
Open Source Platform
like PHP, etc.
Vendor Locked-In
Platform, like ABAP,
etc.
10. @HirofumiIwasaki 10
For Start Making Custom Enterprise Software
Maturity for Huge Mission Critical Systems
OpenStandard,CommunityPower
Microsoft .NET
Framework
Java EE
Open Source Platform
like PHP, etc.
Vendor Locked-In
Platform, like ABAP,
etc.
11. @HirofumiIwasaki 11
Summary: Select Java EE for Enterprise Apps
is even better platform for
Huge, mission critical systems.
Vendor free.
Larger community power.
Amount of engineers.
12. @HirofumiIwasaki 12
Agenda
1. Enterprise Systems and its Features
2. Java EE Specifications for Enterprise Systems
3. Java EE Applying Points for Real Enterprise Systems
a) Start Application Design with Java EE
b) Specify IDE for Modern Development Style
c) Web Front-End with JSF
d) Business Logic with EJB or CDI
e) Data Access with JPA
f) Connectivity with RMI-IIOP, REST and WebSocket
13. @HirofumiIwasaki 13
Java EE Overview
Java EE = Java Platform, Enterprise Edition
Java specification for enterprise systems, not light weight
systems.
– For other matured mission critical systems.
– Especially for financial industry systems.
14. @HirofumiIwasaki 14
Java EE Spec & App Servers
Java EE specification is managed by
Java community process (JCP).
Many vendors are making
Java EE app server
not only for commercial usage
but also for free. Specification
Java EE
App Servers
15. @HirofumiIwasaki 15
History of Java EE Specification
1999 2001 2003 2006 2009 2013 2017
J2EE 1.2 (Dec, 1999)
J2EE 1.3 (Sep, 2001)
J2EE 1.4 (Nov, 2003)
Java EE 5 (May, 2006)
Java EE 6 (May, 2006)
Project
JPE
Java EE 7
(June, 2013)
16. @HirofumiIwasaki 16
1999 2001 2003 2006 2009 2013
Java EE 7 Svrs
J2EE 1.2 Servers
Pre-J2EE
J2EE 1.3 Servers
J2EE 1.4 Servers
Java EE 5 Servers
Java EE 6 Servers
2017
History of Java EE Spec Servers
17. @HirofumiIwasaki 17
Combination of Java EE and Java SE
J2EE
1.2
(1999)
J2EE
1.3
(2001)
J2EE
1.4
(2003)
Java
EE 5
(2006)
Java
EE 6
(2009)
Java
EE 7
(2013)
J2SE
1.2
(1998)
J2SE
1.3
(2000)
J2SE
1.4
(2002)
J2SE
5
(2004)
Java
SE 6
(2006)
Java
SE 7
(2011)
Java
SE 8
(2014)
One EE specification, with latest SE version
Java EE 7 relies on SE 7
Sun
Microsystems Oracle
19. @HirofumiIwasaki 19
Enterprise Systems and Java EE Specifications
JSF
Servlet
Web Front End Business Logic
JTA
CDI
EJB
Back End
JDBCRMI-
IIOP
JAX-
RS
JPA
JMS
JAX-
WS
Web
Socket
JBatch
Java
Mail
20. @HirofumiIwasaki 20
Standardization History of Java EE
J2EE 1.2
J2EE 1.3
J2EE 1.4
Java EE 5
Java EE 6
Java EE 7
Java EE 8
JDBC
EJB/JTA/XA/IIOP
Servlet/JSP
JMS
RMI
SOAP
JPA
JSF/Facelet
REST
CDI
JavaBatch
Project JPE
or earlier
WebSocket
…
…
WebLogic
Hibernate
Spring Framework
21. @HirofumiIwasaki 21
New Specs of Java EE
J2EE 1.2
J2EE 1.3
J2EE 1.4
Java EE 5
Java EE 6
Java EE 7
Java EE 8
JDBC
EJB
JSP
JMS
RMI
SOAP
JPA
JSF/Facelet
REST
CDI
JavaBatch
Project JPE
or earlier
WebSocket
EJBEntityBean
JSP
…
…
22. @HirofumiIwasaki 22
2017: Java EE 8 – Now RevisingOriginalPlan:
FinalRelease:
H12017
RevisedPlan:
FinalRelease:
Q32017
Early
Draft
Public
Review
Propos
ed Final
Draft
Final
Release
2016 2017
Q3, 2017
1H, 2017, canceled
Public
Survey
Propos
ed Final
Draft
Final
Release
23. @HirofumiIwasaki 23
Agenda
1. Enterprise Systems and its Features
2. Java EE Specifications for Enterprise Systems
3. Java EE Applying Points for Real Enterprise Systems
a) Start Application Design with Java EE
b) Specify IDE for Modern Development Style
c) Web Front-End with JSF
d) Business Logic with EJB or CDI
e) Data Access with JPA
f) Connectivity with RMI-IIOP, REST and WebSocket
24. @HirofumiIwasaki 24
Application Design with Java EE: Keywords
App Server and
Version
Vendor
Selection
Java EE
Version
Commercial or
Free
Product
Roadmap
25. @HirofumiIwasaki 25
Rich Clients
Web Presentation Business Logic
(no presentations)
Typical Enterprise Systems
DBs
MQ
Connection Other
Servers
EMail
MTA
Call
Call
Call
Call
Call
Call
Data Access
Messaging
26. @HirofumiIwasaki 26
Rich Clients
Web Presentation Business Logic
(no presentations)
Typical Usage of Java EE 7
JPA
EJBJSF
DBs
Java FX JTA
Automatic
Transaction
JMS MQ
Connection
RMI-IIOP
Other
Servers
EMail
MTAJavaMail
JAX
Call
Call
Call
Call
Call
Call
Data Access
Messaging
CDI
27. @HirofumiIwasaki 27
Use Latest Product, Latest Spec
I'll start my new project with
Java EE.
Which version should use?
Use latest product version,
with latest Java EE specification.
Because latest version is free of EOL,
greater APIs for ease of development.
29. @HirofumiIwasaki 29
Details of Java EE Application Servers
Vendor App Server EE 1.4
(2003-)
EE 5
(2006-)
EE 6
(2009-)
EE 7
(2013-)
Open Source GlassFish / Payara - 2.x 3.x 4.x
Oracle WebLogic 9.x 10.x 12.1 12.2
IBM WebSphere 5.1-6.x 7.0 8.5 8.5.5
Red Hat JBoss 4.x 5.1 6.0 7.0
Red Hat WildFly - - - 8.0-10.0
Hitachi Cosminexus 7.x 8.x 9.x 10.0
TmaxSoft JEUS 5.0 6.0 7.0 8.0
Fujitsu Interstage 9.0,9.1 9.2-11.0 11.1 -
Apache Geronimo - 2.x 3.x -
Apache TomEE - - 1.x -
30. @HirofumiIwasaki 30
Commercial or Free?
Is heavily
SLA required?
Is open source
required?
Some supports
required?
Select Commercial Products Select Free Products
Is there few initial
cost limitation?
Is DIY acceptable?Is long running
upgrading path required?
WebLogic WebSphere JBoss
Cosminexus
/Payara
31. @HirofumiIwasaki 31
Summary: Select Your Appropriate Server
Select the appropriate Java EE server.
Vendor
Applied Java EE version
Free or Commercial
Commercial support required or not
32. @HirofumiIwasaki 32
Agenda
1. Enterprise Systems and its Features
2. Java EE Specifications for Enterprise Systems
3. Java EE Applying Points for Real Enterprise Systems
a) Start Application Design with Java EE
b) Specify IDE for Modern Development Style
c) Web Front-End with JSF
d) Business Logic with EJB or CDI
e) Data Access with JPA
f) Connectivity with RMI-IIOP, REST and WebSocket
34. @HirofumiIwasaki 34
In 1990’s – early 2000’s
“Great Engineers” never
use such IDEs!
Instead, they use text editor!
*Is Japanese special habit not to use IDEs?
35. @HirofumiIwasaki 35
“Great Engineer” never
use such IDEs!
Instead, use text editor!
We’re now living in 2010’s
NEVER
Not good for productivity on
enterprise development.
Apply the latest technologies!
*Is Japanese special habit not to use IDEs?
43. @HirofumiIwasaki 43
Agenda
1. Enterprise Systems and its Features
2. Java EE Specifications for Enterprise Systems
3. Java EE Applying Points for Real Enterprise Systems
a) Start Application Design with Java EE
b) Specify IDE for Modern Development Style
c) Web Front-End with JSF
d) Business Logic with EJB or CDI
e) Data Access with JPA
f) Connectivity with RMI-IIOP, REST and WebSocket
45. @HirofumiIwasaki 45
Rich Clients
Web Presentation Business Logic
(no presentations)
Typical usage of Java EE 7
JPA
EJBJSF
DBs
Java FX JTA
Automatic
Transaction
JMS MQ
Connection
RMI-IIOP
Other
Servers
EMail
MTAJavaMail
JAX
Call
Call
Call
Call
Call
Call
Data Access
Messaging
CDI
46. @HirofumiIwasaki 46
Selection of the front-end frameworks of server side Java
JavaServer Faces
– Genuine Java EE front-end framework
– Many additional components like “PrimeFaces”.
– View-based operation
– Security countermeasures already
implemented like XSS, XSRF.
49. @HirofumiIwasaki 49
Older JSP vs. New Facelet
JavaServer
Pages
Facelet
Compile
Java Servlet
Work
HTML
Rendering
HTML
Rendering
Real-time
Interpreting
&
Work
No Compile,
Rapid Dev.
Re-Deploy
& Compile
Harmful
Dev. Procs
Check
Fix Fix Reload
50. @HirofumiIwasaki 50
Security Countermeasures and JSF
Cross Site
Scripting
(XSS)
Cross Site
Request Forgery
(CSRF)
Output values to
HTML with escaping.
Requirement
Output one time
token for next page
transitions.
JSF
Automatically
operated
Automatically
operated
52. @HirofumiIwasaki 52
Agenda
1. Enterprise Systems and its Features
2. Java EE Specifications for Enterprise Systems
3. Java EE Applying Points for Real Enterprise Systems
a) Start Application Design with Java EE
b) Specify IDE for Modern Development Style
c) Web Front-End with JSF
d) Business Logic with EJB or CDI
e) Data Access with JPA
f) Connectivity with RMI-IIOP, REST and WebSocket
54. @HirofumiIwasaki 54
Rich Clients
Web Presentation Business Logic
(no presentations)
Typical usage of Java EE 7
JPA
EJBJSF
DBs
Java FX JTA
Automatic
Transaction
JMS MQ
Connection
RMI-IIOP
Other
Servers
EMail
MTAJavaMail
JAX
Call
Call
Call
Call
Call
Call
Data Access
Messaging
CDI
55. @HirofumiIwasaki 55
Two Solutions for Realtime Logics: EJB or CDI
For Heavy & Mission-Critical
Business Logics
CDIEJB
Context and Dependency
Injection
For Light-weight Logics,
Rapid, Ease of Development
57. @HirofumiIwasaki 57
Review: CDI – Light Version of EJB
CDIClient
1. Remote Invocation
CDI
2. Automatic Transaction Management
Database
(BEGIN)
(COMMIT)
EJB
EJB
Instance
Pool
Activate
3. Instance Pooling for Faster Operation
RMI-IIOP
SOAP
REST
Web Socket
Client
4. Security Management
Few Functions, Faster Deployment
58. @HirofumiIwasaki 58
POJO
Java EE ServerJava EE Server
Java Batch
How Design the Batch Logics?
Choice 1: Use EJB/CDI,
Call via EJB/CDI Remote
from Outside
EJB
Batch
Batch
Kicker Call
Choice 2: Use
Java Batch Framework,
Call from Outside
Batch
Kicker Call
Choice 3:
Micro Service
(Java EE 9 style)
Batch
Kicker Call
Full automatic transaction,
Able to use embedded server.
If the standard templates
suitable for your app, try it.
Not released yet, but you can
try with Payara Micro now.
60. @HirofumiIwasaki 60
Agenda
1. Enterprise Systems and its Features
2. Java EE Specifications for Enterprise Systems
3. Java EE Applying Points for Real Enterprise Systems
a) Start Application Design with Java EE
b) Specify IDE for Modern Development Style
c) Web Front-End with JSF
d) Business Logic with EJB or CDI
e) Data Access with JPA
f) Connectivity with RMI-IIOP, REST and WebSocket
61. @HirofumiIwasaki 61
Data Access: Keywords
Java
Persistence API
(JPA)
Data Access
Object (DAO)
JDBC
Auto
Generation
Java
Persistence
Query
Language
(JPQL)
62. @HirofumiIwasaki 62
Rich Clients
Web Presentation Business Logic
(no presentations)
Typical usage of Java EE 7
JPA
EJBJSF
DBs
Java FX JTA
Automatic
Transaction
JMS MQ
Connection
RMI-IIOP
Other
Servers
EMail
MTAJavaMail
JAX
Call
Call
Call
Call
Call
Call
Messaging
Data Access
CDI
64. @HirofumiIwasaki 64
JPA – Simple Database Mapper
Relational Database
(E-R Diagram)
One by One
JPA Entity
(Class Diagram)
Auto Generate
With Bean Validation
65. @HirofumiIwasaki 65
JPA – Simple Database Mapper
JPA Entity
JPA Data Access Object (DAO)
Auto CRUD
to Database
Access to RDB
66. @HirofumiIwasaki 66
public List<Member> findMemberByName(String name) {
String queryString = "SELECT a FROM Member m " +
"WHERE m.name = LOWER(:name)";
Query query = getEntityManager().createQuery(queryString);
query.setParameter("name", name);
List<Member> result = query.getResultList();
}
JPA Custom Queries – JPQL and Criteria Query
JPQL:
Criteria Query:
public List<Member> findMemberByName(String name) {
CriteriaBuilder builder = this.em.getCriteriaBuilder();
CriteriaQuery query = builder.createQuery();
Root<Member> member = query.from(Member.class);
query.select(member);
query.where(builder.equal(member.get(”name"), name));
List<Member> result = this.em.createQuery(query).getResultList();
}
67. @HirofumiIwasaki 67
JTA Transaction
Management
Java EE Application
EJB Business Logic
Why You Should Not Use Raw JDBC in Java EE?
Java EE Application Server
Java VM
Connection
Pool
EJB Object
Pool
Thread
Pool
Self-Managed
JDBC Connection
JPA
Entity Manager
JNDI
JDBC
Driver Manager
RAW
?
?
No Global Transaction
No Connection Management
68. @HirofumiIwasaki 68
Combination with EJB Session Bean
Business Logic
(no presentations)
JPA
EJB
DBs
JTA
Automatic
Transaction
Call
Full automatic
transaction management
with EJB session bean
JPA entity manager
automatically join
the CMT of EJB
Data Access
69. @HirofumiIwasaki 69
Summary: Use JPA, Instead of Raw JDBC.
Apply JPA ordinarily for data,
within the EJB / CDI
Container
Managed Transaction
(CMT)
70. @HirofumiIwasaki 70
Agenda
1. Enterprise Systems and its Features
2. Java EE Specifications for Enterprise Systems
3. Java EE Applying Points for Real Enterprise Systems
a) Start Application Design with Java EE
b) Specify IDE for Modern Development Style
c) Web Front-End with JSF
d) Business Logic with EJB or CDI
e) Data Access with JPA
f) Connectivity with RMI-IIOP, REST and WebSocket
73. @HirofumiIwasaki 73
Supported protocols of Java EE 7 (EJB)
Protocol Supported
From
Annotation Client Stub Value
Marshaling
Global
Transaction
RMI-IIOP J2EE 1.2 @Remote in
remote interface
Remote interface
with auto generate
Auto XA Supported
SOAP Java EE 5 @WebService Auto generate in
development
Auto N/A
REST Java EE 6 @GET, @POST,
etc.
(Nothing special) Work with JSON
or something
(string base)
N/A
Web Socket Java EE 7 @ServerEndpoint @ClientEndpoint
with auto generate
Work with JSON
or something
(string base)
N/A
74. @HirofumiIwasaki 74
Global Transaction
Management
with XA Protocol
For heavy transaction: consider RMI-IIOP
EJB
Session BeanClient RMI-IIOP
Other
System’s
EJB
Database
Other
Enterprise
Information
Systems
IIOP
AUTO
BEGIN
AUTO
COMMIT
75. @HirofumiIwasaki 75
For light-weight usage: consider Web Socket / REST + JSON
Local Transaction
Management
EJB
Session BeanClient Web Socket or REST
Database
AUTO
BEGIN
AUTO
COMMIT
Ultra-Fast,
Ease of Dev.
76. @HirofumiIwasaki 76
EJB Session Bean with RMI-IIOP and Web Socket
@Stateless
@Remote
@ServerEndpoint(value = "/memberlogic")
public class MemberLogic implements MemberLogicRemote {
@OnMessage
public String register(String message, Session session) {
// WRITE TRANSACTIONAL LOGICS HERE!
return xxxx;
}
}
EJB
RMI-IIOP
Web Socket
Some Clients
Transactional
Processing
for RMI-IIOP
for Web Socket
for RMI-IIOP
for Web Socket
77. @HirofumiIwasaki 77
Summary: Recommendation of Protocols
Select the RMI-IIOP
for heavy transactional distributed systems.
Select the Web Socket or REST
for system that requires light-weight and
faster speed.
78. @HirofumiIwasaki 78
Summary
Enterprise systems require many
mission critical basement.
Java EE is one of the best platform
on the aspect of the vendor free.
Consider many critical points when
Java EE design & development start.