Please enable JavaScript.
Coggle requires JavaScript to display documents.
Java EE - The big picture (01- Java EE - The big picture (The Java…
Java EE - The big picture
01- Java EE - The big picture
The Java Platform
Object oriented programming language
C-like syntax
portable
Java platform is an environment where Java apps run
4 platforms - Java Standard Edition, Java Micro Edition, Java FX (effects), Java Enterprise Edition (J2EE)
Each platform has its own JVM and API. JVM's are different for different OS's
Java SE
Core platform
Core libraries & API that all Java programmer should learn
JDK
JVM
Dev Tools
Deployment & monitoring
Java ME
subset of Java SE for mobile devices
small JVM to run on mobile devices, tv's, set top boxes, IOT
Java FX
create RIA using light weight user interface API
Java EE
Java EE extends Java SE
Enterprise softwares
Distributed systems
Java SE, Java ME, Java FX are often clients of Java EE
Enterprise Applications
Multi-tier, scalable, reliable, secure
solves the problems of large enterprise
tiered applications
client
Java SE, Java FX, Java ME apps
middle
Web tier, business tier, interoperability tier
enterprise application tier
databases, legacy systems, mainframes
client tier request middle tiers which are usually located on different machines, which might interact with a web service or databases, main
frames, legacy systems
Java SE vs Java EE
We use Java API for collections like set, map. We dont create it. Similarly Java EE provides us with API to handle transactions, messaging, persistence
Enterprise apps are powerful but complex, Java EE reduces complexity, provides us a programming model, API's, runtime env, so that developers can concentrate on business req and not the low level details
Java EE programming model
In Java SE we write all of database code using JDBC. We write SQL in Java code, low level API of JDBC to convert rows and columns to objects, SQL is not easy to re-factor, hard to read, hard to maintain.
Create a Books class and BookManager class which manages retrieval and insertion of books in database using JDBC
Using Java EE we add metadata like
Entity,
Id.
Create a Book class, add metadata. Create BookService class. We abstract away read & insert code using dependency injections.
Adv: no manual mapping, no SQL statements, higher level of abstraction
02- What's Java EE
Java EE Architecture
Container is a runtime environment which provides services to the components it hosts. Services like lifecycle management, concurrency, dependency injection. Components use API to communicate with Java EE container. Components needs to be packaged before deploying to the container.
Container
Runtime Env
hides technical complexity
enhance portability
handle complex low level details
Components
managed by container
static or dynamic web pages
server side java classes handles business code, process data
components accessing legacy systems
Services
used by components
security, transaction management, naming, remote connectivity
configurable
Metadata
annotations
external XML deployment descriptor
container provides all the required services through IOC
Application
aggregation of components
web pages, web resources - images, styles. js, business components, database access components, xml deployment descriptor file
all of these components are packaged into an archive n deployed to the container
Protocols
http/https/RMI to interact with application
Clients
web clients, web applications, REST/SOAP services, Mobile Apps, B2B
distributed applications
applications deployed on different containers interact with each other. This allows load balancing in case of fail overs.
Java EE Services
Business Tier
handles business logic
transactions
persistence
validation
batch processing
Web Tier
mediator between web clients and business tier
servlets
web pages
expression language
web sockets
Interoperability Tier
helps interacting with external services
SOAP, REST, Messaging, Email, Connector
Common to most Tiers
dependency injection
interception
security
concurrency
02- Java EE in action
containers
open source - JBoss, Glassfish, Tomcat
commercial- oracle web logic, IBM websphere