SlideShare a Scribd company logo
1 of 10
Download to read offline
Introduction to Java Enterprise Edition
                      1
By: Abdalla Mahmoud



Contents
            Introduction to Java Enterprise Edition............................................... 1
              Contents ........................................................................................... 1
              Preface ............................................................................................. 3
              1. Distributed Systems ........................................................................ 3
                1.1. Application Architecture ............................................................. 4
                1.2. Application Design ..................................................................... 4
              2. Middleware .................................................................................... 4
              3. Java Enterprise Edition Platform........................................................ 5
                3.1. Application Architecture ............................................................. 6
                3.2. Application Design ..................................................................... 7
              4. The Java EE Application Server ......................................................... 9
                4.1. Runtime ................................................................................... 9
                4.2. Services.................................................................................. 10
                4.3. Final Image - Java EE Architecture .............................................10




1. http://www.abdallamahmoud.com/



                                                      1
2
Preface

In Java SE, we used to develop desktop applications. Now imagine the situation where
many desktops should be involved in a certain system; it's found in customer support
centers, modern retailer shops, eGov systems, eLearning systems, and so on. Those types of
systems consist of many computers connected together via a network, and all operating in
a central database, cooperating to form a single and concrete system. These systems are
called distributed systems.


1. Distributed Systems

   A distributed system is a collection of computers connected together via a network, and
appear to the users as a single system. Different characteristics are common to all distributed
systems, including resource sharing, openness, concurrency, scalability, fault tolerance, and
transparency. The web is a common example for a distributed system.


       Resource Sharing: in a distributed system, resources are used by many users and
       computers in the network. So resources like files, printers, databases, and so on
       should be shared. Resource sharing includes naming each resource in the system,
       and provide it with a standardized interface to be accessed with.

       Openness: Openness describes the ability of interacting with others. We use
       openness term for describing one's ability of making communication with the
       others. It's the same in distributed systems, openness describes system's ability for
       interacting with other systems.

       Concurrency: many users will access the system simultaneously, use resources
       like files and databases in the same time. Concurrency is a property of a distributed
       system describing its ability for managing many users access to resources
       instantaneously.

       Scalability: the ability of a distributed systems to adding new resources and users.

       Fault Tolerance: computers fail! When a computer in a distributed system is down,
       the distributed system should continue working and functioning properly.

       Transparency: resources should be decoupled from the users. Users should be
       able to access resources transparently without caring where the resource is actually
       located in. Many users should access the same resource without taking in concern
       that many other users may access the resource in the same time. In addition,
       resources may be moved from a location to other while in use, without stopping the
       system or notifying the users, where the component should continue working and
       functioning properly. This's called transparency.


We're going to study distributed systems from two prescriptives:
     • Application architecture.
     • Application design.




                                              3
1.1. Application Architecture

A distributed system is a collection of computers connected together via a network. We have
studied client/server architecture (where the application is divided into two tiers: server tier
that provides a service, and a client tier that consumes the service) in two contexts: socket
programming in the ShoutBox application, and database programming when we used JDBC
API together with the JDBC driver to connect to a relational database server (PostgreSQL).

Most distributed systems are implemented in what's called Three-Tier architecture. Three-
Tier architecture is an extension to the client/server architecture where business data,
application processing, and presentation are separated from each other.

A common example is separating Database (business data), business logic (application
processing), and user interface (presentation) from each other. In other words, the database
is an independent subsystem, the business logic is an independent subsystem, and the user
interface is an independent subsystem, as well. Some issues should be concerned when
designing an application with such architectures:


       Protocols as computers connect together, protocols should be defined. Most
       protocols are too complex to implement and abstractions are needed.

       Security as computers connect together, they are exposed to each others. Only
       authenticated users should access the systems, and only authorized users should be
       able to access resources. In addition, protocols may provide some type of security
       by encrypting conversation using encryption techniques like public/private key.


1.2. Application Design

Most distributed systems are designed in what's called component-based model. The system
is composed of well-defined software components that are assembled together to form the
final system. The definition may seem similar to the object-oriented concept, but they differ.

A software component is a logical term describing a self-contained software unit that's
accessible using standard interfaces. A software component is different to software objects
in that software components are accessible within the scope of a distributed systems (i.e.
components can be accessed remotely), where software objects are accessible only within
the scope of single application (i.e. objects cannot be accessed remotely).



2. Middleware

   As we just seen, distributed systems require heavy system programming. It's too complex
to build a distributed system; it requires too complex implementaiton of the system
architecture, communication protocols, t architecture, support to components, etc. In
addition, the purpose of the system target mainly the business itself (not the distributed
system), developers should focus on implementing the business logic itself, not the complex
 distributed system requirements. Hence, the term middleware has been introduced.

A middleware is a class of software that's developed to manage a distributed system. It's
responsible for implementing the complex details of a distributed system, and providing a




                                               4
virtual development platform of a single system with component-based model, that's actually
distributed over many computers.

You're (as the application developer) responsible only for developing software-components
and deploy them on the middleware, which will run them in managed environment of a
distributed computing model, providing them was all needed system services.




3. Java Enterprise Edition Platform

   The Java EE is complete platform for developing multi-tiered distributed applications. It
consists of:
     • The Java Virtual Machine (JVM).
     • The Java SE APIs (SE APIs).
     • The Java EE Application Server.
     • The Java EE APIs (EE APIs).

As you must have noticed, the Java EE Platform consists of the Java SE Platform (JVM and
SE APIs), with two additions:


       - The Java EE Application Server

       A middleware that supports the distributed system. It implements the system
       programming part of the distributed system, and provides a platform for
       developing component-based applications that run in a managed environment.

       - The Java EE APIs




                                             5
A set of APIs that provides the common functionalities needed in enterprise
       systems.


3.1. Application Architecture




   In Java EE, applications are divided into four teirs: Enterprise Information System (EIS)
tier, business tier, web tier, and client tier.


       3.1.1. EIS Tier

       The Enterprise information system tier contains the enterprise information system
       server that contains the data of the application. It is usually the Relational DBMS.

       3.1.2 Business Tier

       The Business tier contains business components where business logic is
                    2
       implemented.




                                              6
3.1.3 Web Tier
                                                                                   3
       The web tier contains web components that generate dynamic web pages over
       hyper text transfer protocol (HTTP). Pages are accessed using the web browser,
       that's known in Java EE as the thin client.

       3.1.4 Client Tier

       The client tier access system services. There are two variations of the client tier:

           1. Swing Application: in case the client access the business components.
           2. Web Browser: in case the client access the web components.


3.2. Application Design


In Java EE, applications are developed using a component-based model. The Java EE
platform provides different types of components that can be developed and deployed on the
application server. We will study two different types of components: business components
and web components.


       3.2.1 Business Components

       Business components (known as: Enterprise JavaBeans, or EJB in short) are
       developed to implement business logic. EJBs are standard components that can be
                                  4
       accessed remotely using RMI . There're two types of EJBs:


              - Session Beans.
              - Message-Driven Beans.


       3.2.2 Web Components

       Web components are responsible for generating web pages and documents. There're
       two types of Web components:


              - Servlets.
              - JSPs (JavaServer Pages).



2. Business logic includes processing data for operations like accounting, inventory, HR
management, and so on.
3. Web pages are usually HTML pages that are either static or dynamic. In case of static
web pages, content does not change and every time the browser visits the page it receives
the same content. Dynamic pages however, are created dynamically when the browser
request the page. The page is generated dynamically and the browser may receives
different content each time it visits the page.
4. Remote Method Invocation: a Java API for implementing remote procedure calls (RPCs).



                                              7
5
There are significant differences between Plain Old Java Objects (POJOS)          and Java EE
components:


       - Components are standardized.

       Java EE components should implement certain interfaces, extend some class, or
       following any other standard required by the specification to be certified as a
       component in Java EE platform. Unlike POJOs, classes should not follow any certain
       standard requirement.

       - Components are managed by the Java EE Application Server.

       Enterprise applications do not run by themselves as standalone applications,
       instead, they should run in a managed environment provided by the Java EE
       application server. Thus, components are developed and compiled, then deployed
       on the Java EE application server. Application server then runs them in its managed
       environment. Unlike POJOs, where we used to run the class with the main() method.
       In other words, Java EE applications does not have main() method.

       In addition, components are not accessed directly. The client tier access components
       using standard interfaces. Unlike POJOs, where we used to access the object directly
       using its reference. In other words, the application server acts as a service layer
       between the client tier and other tiers.

       - Components are not instantiated using new operator.

       In distributed systems, components are not accessed directly. Instead, component
       are named and located. When the developer deploys a component on the application
       server, she gives the component a unique name. The client then asks the application
       server to locate the component, and instantiate it for him, using its name.

       In other words, the client does not instantiate the component, but the application
       server is responsible for instantiating and returning a reference to the component
       for the sake of the client.

       - All components are developed for the sake of the client.

       Take in concentration that the ultimate purpose of Java EE is to develop distributed
       multi-tiered applications. Thus, all components are developed and deployed to
       provide a service that's actually used by a consumer, the client.

       Every EE application we are going to develop will has clients to access our developed
       system. Either we will develop the client ourselves in case of Swing Application
       clients, or the client will be the web browser in case of accessing web components.




5. The ordinary java objects we used to develop and use in Java SE applications.



                                             8
4. The Java EE Application Server

   The Java EE application server is a specification by Sun Microsystems that describes
a middleware system. The system should provide a managed environment for Java EE
components, in addition to an implementation to the Java EE APIs. Java EE APIs are a
specification, as well.

Any system that implements the Java EE application server and Java EE APIs specification
is called Java EE application server, or application server in short. In fact, any vendor can
implement the specification, but should get certified first by Sun that her implemntation is a
valid application server.

There are dozens of application servers in the market. Here is a list of some application
servers and their vendors:

     Application Server                   Vendor                            Type
Glassfish                      Sun                             Open Source/Free
JBoss                          RedHat                          Open Source/Free Edition
WebSphere                      IBM                             Open Source/Free Edition
OC4J                           ORACLE                          Commercial

We will use JBoss application server, that can be downloaded from: http://www.jboss.org/.

Your role, as the application developer, is to only develop Java EE components according to
the specification, then deploy them on the application server. Since both the components and
application servers are developed according to the specification, any Java EE application can
run on any Java EE application server, which is the sexiest property of the Java EE platform.


4.1. Runtime

The application server provides the runtime platform in the form of containers. A container
is a component of the application server that manages a specific type of components and
provide them with all the needed services and Java EE API implementaiton. We will study two
types of containers:


        - Business Container

        The business container is responsible for managing business components and
        providing them with runtime services like: RMI communication, database
        manipulation, transaction services, etc.

        - Web Container

        The web container is responsible for managing web components and providing them
        with runtime services like: HTTP communication, database manipulation, etc.




                                              9
4.2. Services

The application server provides each container with a set of required services. The service is
implemented and supported to the application developer via Java EE APIs. Services include:


       - Remote Method Invocation (RMI).
       - HTTP (Hypertext transfer protocol).
       - HTTPs (HTTP over SSL).
       - Java Messaging Service (JMS). Supported via JMS APIs.
       - Java Naming and Directory Interface. Supported via JNDI APIs.
       - Distributed Transactions Management. Supported via Java Transactions APIs
       (JTA).
       - Java Database Connectivity. Supported via JDBC APIs.
       - Persistence. Supported via Java Persistence API (JPA).
       - Java Authentication and Authorization Service (JAAS).


4.3. Final Image - Java EE Architecture




                                             10

More Related Content

What's hot

Oracle Enterprise Manager Cloud Control 12c - Top 10 Features for DBAs
Oracle Enterprise Manager Cloud Control 12c - Top 10 Features for DBAsOracle Enterprise Manager Cloud Control 12c - Top 10 Features for DBAs
Oracle Enterprise Manager Cloud Control 12c - Top 10 Features for DBAs
Leighton Nelson
 
OIT552 Cloud Computing - Question Bank
OIT552 Cloud Computing - Question BankOIT552 Cloud Computing - Question Bank
OIT552 Cloud Computing - Question Bank
pkaviya
 
Data virtualization
Data virtualizationData virtualization
Data virtualization
Hamed Hatami
 

What's hot (20)

Designing For Occasionally Connected Apps Slideshare
Designing For Occasionally Connected Apps SlideshareDesigning For Occasionally Connected Apps Slideshare
Designing For Occasionally Connected Apps Slideshare
 
A Crash Course in SQL Server Administration for Reluctant Database Administra...
A Crash Course in SQL Server Administration for Reluctant Database Administra...A Crash Course in SQL Server Administration for Reluctant Database Administra...
A Crash Course in SQL Server Administration for Reluctant Database Administra...
 
Cloud architecture
Cloud architectureCloud architecture
Cloud architecture
 
Cloud Analytics and VDI
Cloud Analytics and VDICloud Analytics and VDI
Cloud Analytics and VDI
 
Cloud computing notes unit II
Cloud computing notes unit II Cloud computing notes unit II
Cloud computing notes unit II
 
Database project
Database projectDatabase project
Database project
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 novelties
 
ASMUG February 2015 Knowledge Event
ASMUG February 2015 Knowledge EventASMUG February 2015 Knowledge Event
ASMUG February 2015 Knowledge Event
 
Oracle Enterprise Manager Cloud Control 12c - Top 10 Features for DBAs
Oracle Enterprise Manager Cloud Control 12c - Top 10 Features for DBAsOracle Enterprise Manager Cloud Control 12c - Top 10 Features for DBAs
Oracle Enterprise Manager Cloud Control 12c - Top 10 Features for DBAs
 
It summit 150604 cb_wcl_ld_kmh_v6_to_publish
It summit 150604 cb_wcl_ld_kmh_v6_to_publishIt summit 150604 cb_wcl_ld_kmh_v6_to_publish
It summit 150604 cb_wcl_ld_kmh_v6_to_publish
 
Diagnosability versus The Cloud, Redwood Shores 2011-08-30
Diagnosability versus The Cloud, Redwood Shores 2011-08-30Diagnosability versus The Cloud, Redwood Shores 2011-08-30
Diagnosability versus The Cloud, Redwood Shores 2011-08-30
 
Architecture and Distributed Systems, Web Distributed Systems Design
Architecture and Distributed Systems, Web Distributed Systems DesignArchitecture and Distributed Systems, Web Distributed Systems Design
Architecture and Distributed Systems, Web Distributed Systems Design
 
OIT552 Cloud Computing - Question Bank
OIT552 Cloud Computing - Question BankOIT552 Cloud Computing - Question Bank
OIT552 Cloud Computing - Question Bank
 
Data virtualization
Data virtualizationData virtualization
Data virtualization
 
CouchBase The Complete NoSql Solution for Big Data
CouchBase The Complete NoSql Solution for Big DataCouchBase The Complete NoSql Solution for Big Data
CouchBase The Complete NoSql Solution for Big Data
 
Rethink your architecture - Marten Deinum
Rethink your architecture - Marten DeinumRethink your architecture - Marten Deinum
Rethink your architecture - Marten Deinum
 
Cloud database
Cloud databaseCloud database
Cloud database
 
My aws cp study (autosaved)
My aws cp study (autosaved)My aws cp study (autosaved)
My aws cp study (autosaved)
 
Oracle
OracleOracle
Oracle
 
Oracle Data Warehouse
Oracle Data WarehouseOracle Data Warehouse
Oracle Data Warehouse
 

Viewers also liked

The 10 Principles of Enterprise Architecture
The 10 Principles of Enterprise ArchitectureThe 10 Principles of Enterprise Architecture
The 10 Principles of Enterprise Architecture
Info-Tech Research Group
 
Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)
Atit Patumvan
 

Viewers also liked (11)

Java Enterprise Edition
Java Enterprise EditionJava Enterprise Edition
Java Enterprise Edition
 
J2EE Introduction
J2EE IntroductionJ2EE Introduction
J2EE Introduction
 
Stereoscopic imaging 1
Stereoscopic imaging 1Stereoscopic imaging 1
Stereoscopic imaging 1
 
The 10 Principles of Enterprise Architecture
The 10 Principles of Enterprise ArchitectureThe 10 Principles of Enterprise Architecture
The 10 Principles of Enterprise Architecture
 
Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)
 
J2EE and layered architecture
J2EE and layered architectureJ2EE and layered architecture
J2EE and layered architecture
 
J2ee architecture
J2ee architectureJ2ee architecture
J2ee architecture
 
Java EE Introduction
Java EE IntroductionJava EE Introduction
Java EE Introduction
 
Enterprise Java Beans - EJB
Enterprise Java Beans - EJBEnterprise Java Beans - EJB
Enterprise Java Beans - EJB
 
EJB .
EJB .EJB .
EJB .
 
Building Enterprise Application with J2EE
Building Enterprise Application with J2EEBuilding Enterprise Application with J2EE
Building Enterprise Application with J2EE
 

Similar to Introduction to Java Enterprise Edition

J2EE Notes JDBC database Connectiviy and Programs related to JDBC
J2EE Notes JDBC database Connectiviy and Programs related to JDBCJ2EE Notes JDBC database Connectiviy and Programs related to JDBC
J2EE Notes JDBC database Connectiviy and Programs related to JDBC
ChaithraCSHirematt
 
Peoplesoft PIA architecture
Peoplesoft PIA architecturePeoplesoft PIA architecture
Peoplesoft PIA architecture
Amit rai Raaz
 
Design Decisions For Understanding Software Architecture
Design Decisions For Understanding Software ArchitectureDesign Decisions For Understanding Software Architecture
Design Decisions For Understanding Software Architecture
Tiffany Graham
 
Distributed Systems Architecture in Software Engineering SE11
Distributed Systems Architecture in Software Engineering SE11Distributed Systems Architecture in Software Engineering SE11
Distributed Systems Architecture in Software Engineering SE11
koolkampus
 

Similar to Introduction to Java Enterprise Edition (20)

J2EE Notes JDBC database Connectiviy and Programs related to JDBC
J2EE Notes JDBC database Connectiviy and Programs related to JDBCJ2EE Notes JDBC database Connectiviy and Programs related to JDBC
J2EE Notes JDBC database Connectiviy and Programs related to JDBC
 
Peoplesoft PIA architecture
Peoplesoft PIA architecturePeoplesoft PIA architecture
Peoplesoft PIA architecture
 
Software Architecture for Robotics
Software Architecture for RoboticsSoftware Architecture for Robotics
Software Architecture for Robotics
 
College information management system.doc
College information management system.docCollege information management system.doc
College information management system.doc
 
Over view of software artitecture
Over view of software artitectureOver view of software artitecture
Over view of software artitecture
 
Design Decisions For Understanding Software Architecture
Design Decisions For Understanding Software ArchitectureDesign Decisions For Understanding Software Architecture
Design Decisions For Understanding Software Architecture
 
Liferay architecture By Navin Agarwal
Liferay architecture By Navin AgarwalLiferay architecture By Navin Agarwal
Liferay architecture By Navin Agarwal
 
IRJET- Conversational Commerce (ESTILO)
IRJET- Conversational Commerce (ESTILO)IRJET- Conversational Commerce (ESTILO)
IRJET- Conversational Commerce (ESTILO)
 
IRJET- Design of Closed Loop PI Controller Based Hybrid Z-Source DC-DC Conver...
IRJET- Design of Closed Loop PI Controller Based Hybrid Z-Source DC-DC Conver...IRJET- Design of Closed Loop PI Controller Based Hybrid Z-Source DC-DC Conver...
IRJET- Design of Closed Loop PI Controller Based Hybrid Z-Source DC-DC Conver...
 
Ch12
Ch12Ch12
Ch12
 
Online Attendance Management System
Online Attendance Management SystemOnline Attendance Management System
Online Attendance Management System
 
Distributed Systems Architecture in Software Engineering SE11
Distributed Systems Architecture in Software Engineering SE11Distributed Systems Architecture in Software Engineering SE11
Distributed Systems Architecture in Software Engineering SE11
 
lect 1TO 5.pptx
lect 1TO 5.pptxlect 1TO 5.pptx
lect 1TO 5.pptx
 
Distributed Software Engineering with Client-Server Computing
Distributed Software Engineering with Client-Server ComputingDistributed Software Engineering with Client-Server Computing
Distributed Software Engineering with Client-Server Computing
 
Chapter 2 - Enterprise Application Integration.pdf
Chapter 2 - Enterprise Application Integration.pdfChapter 2 - Enterprise Application Integration.pdf
Chapter 2 - Enterprise Application Integration.pdf
 
Middleware – Its Types, Architecture, and Benefits.docx
Middleware – Its Types, Architecture, and Benefits.docxMiddleware – Its Types, Architecture, and Benefits.docx
Middleware – Its Types, Architecture, and Benefits.docx
 
Development Tools - Abhijeet
Development Tools - AbhijeetDevelopment Tools - Abhijeet
Development Tools - Abhijeet
 
Xenapp deployment-blueprint
Xenapp deployment-blueprintXenapp deployment-blueprint
Xenapp deployment-blueprint
 
Java remote control for laboratory monitoring
Java remote control for laboratory monitoringJava remote control for laboratory monitoring
Java remote control for laboratory monitoring
 
Laboratory Information Management System
Laboratory Information Management SystemLaboratory Information Management System
Laboratory Information Management System
 

More from Abdalla Mahmoud

More from Abdalla Mahmoud (9)

Persistence
PersistencePersistence
Persistence
 
JavaServer Pages
JavaServer PagesJavaServer Pages
JavaServer Pages
 
Java EE Services
Java EE ServicesJava EE Services
Java EE Services
 
Message Driven Beans (6)
Message Driven Beans (6)Message Driven Beans (6)
Message Driven Beans (6)
 
Servlets
ServletsServlets
Servlets
 
Introduction to the World Wide Web
Introduction to the World Wide WebIntroduction to the World Wide Web
Introduction to the World Wide Web
 
Object-Oriented Concepts
Object-Oriented ConceptsObject-Oriented Concepts
Object-Oriented Concepts
 
One-Hour Java Talk
One-Hour Java TalkOne-Hour Java Talk
One-Hour Java Talk
 
Being Professional
Being ProfessionalBeing Professional
Being Professional
 

Recently uploaded

Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
FIDO Alliance
 

Recently uploaded (20)

The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
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
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 

Introduction to Java Enterprise Edition

  • 1. Introduction to Java Enterprise Edition 1 By: Abdalla Mahmoud Contents Introduction to Java Enterprise Edition............................................... 1 Contents ........................................................................................... 1 Preface ............................................................................................. 3 1. Distributed Systems ........................................................................ 3 1.1. Application Architecture ............................................................. 4 1.2. Application Design ..................................................................... 4 2. Middleware .................................................................................... 4 3. Java Enterprise Edition Platform........................................................ 5 3.1. Application Architecture ............................................................. 6 3.2. Application Design ..................................................................... 7 4. The Java EE Application Server ......................................................... 9 4.1. Runtime ................................................................................... 9 4.2. Services.................................................................................. 10 4.3. Final Image - Java EE Architecture .............................................10 1. http://www.abdallamahmoud.com/ 1
  • 2. 2
  • 3. Preface In Java SE, we used to develop desktop applications. Now imagine the situation where many desktops should be involved in a certain system; it's found in customer support centers, modern retailer shops, eGov systems, eLearning systems, and so on. Those types of systems consist of many computers connected together via a network, and all operating in a central database, cooperating to form a single and concrete system. These systems are called distributed systems. 1. Distributed Systems A distributed system is a collection of computers connected together via a network, and appear to the users as a single system. Different characteristics are common to all distributed systems, including resource sharing, openness, concurrency, scalability, fault tolerance, and transparency. The web is a common example for a distributed system. Resource Sharing: in a distributed system, resources are used by many users and computers in the network. So resources like files, printers, databases, and so on should be shared. Resource sharing includes naming each resource in the system, and provide it with a standardized interface to be accessed with. Openness: Openness describes the ability of interacting with others. We use openness term for describing one's ability of making communication with the others. It's the same in distributed systems, openness describes system's ability for interacting with other systems. Concurrency: many users will access the system simultaneously, use resources like files and databases in the same time. Concurrency is a property of a distributed system describing its ability for managing many users access to resources instantaneously. Scalability: the ability of a distributed systems to adding new resources and users. Fault Tolerance: computers fail! When a computer in a distributed system is down, the distributed system should continue working and functioning properly. Transparency: resources should be decoupled from the users. Users should be able to access resources transparently without caring where the resource is actually located in. Many users should access the same resource without taking in concern that many other users may access the resource in the same time. In addition, resources may be moved from a location to other while in use, without stopping the system or notifying the users, where the component should continue working and functioning properly. This's called transparency. We're going to study distributed systems from two prescriptives: • Application architecture. • Application design. 3
  • 4. 1.1. Application Architecture A distributed system is a collection of computers connected together via a network. We have studied client/server architecture (where the application is divided into two tiers: server tier that provides a service, and a client tier that consumes the service) in two contexts: socket programming in the ShoutBox application, and database programming when we used JDBC API together with the JDBC driver to connect to a relational database server (PostgreSQL). Most distributed systems are implemented in what's called Three-Tier architecture. Three- Tier architecture is an extension to the client/server architecture where business data, application processing, and presentation are separated from each other. A common example is separating Database (business data), business logic (application processing), and user interface (presentation) from each other. In other words, the database is an independent subsystem, the business logic is an independent subsystem, and the user interface is an independent subsystem, as well. Some issues should be concerned when designing an application with such architectures: Protocols as computers connect together, protocols should be defined. Most protocols are too complex to implement and abstractions are needed. Security as computers connect together, they are exposed to each others. Only authenticated users should access the systems, and only authorized users should be able to access resources. In addition, protocols may provide some type of security by encrypting conversation using encryption techniques like public/private key. 1.2. Application Design Most distributed systems are designed in what's called component-based model. The system is composed of well-defined software components that are assembled together to form the final system. The definition may seem similar to the object-oriented concept, but they differ. A software component is a logical term describing a self-contained software unit that's accessible using standard interfaces. A software component is different to software objects in that software components are accessible within the scope of a distributed systems (i.e. components can be accessed remotely), where software objects are accessible only within the scope of single application (i.e. objects cannot be accessed remotely). 2. Middleware As we just seen, distributed systems require heavy system programming. It's too complex to build a distributed system; it requires too complex implementaiton of the system architecture, communication protocols, t architecture, support to components, etc. In addition, the purpose of the system target mainly the business itself (not the distributed system), developers should focus on implementing the business logic itself, not the complex distributed system requirements. Hence, the term middleware has been introduced. A middleware is a class of software that's developed to manage a distributed system. It's responsible for implementing the complex details of a distributed system, and providing a 4
  • 5. virtual development platform of a single system with component-based model, that's actually distributed over many computers. You're (as the application developer) responsible only for developing software-components and deploy them on the middleware, which will run them in managed environment of a distributed computing model, providing them was all needed system services. 3. Java Enterprise Edition Platform The Java EE is complete platform for developing multi-tiered distributed applications. It consists of: • The Java Virtual Machine (JVM). • The Java SE APIs (SE APIs). • The Java EE Application Server. • The Java EE APIs (EE APIs). As you must have noticed, the Java EE Platform consists of the Java SE Platform (JVM and SE APIs), with two additions: - The Java EE Application Server A middleware that supports the distributed system. It implements the system programming part of the distributed system, and provides a platform for developing component-based applications that run in a managed environment. - The Java EE APIs 5
  • 6. A set of APIs that provides the common functionalities needed in enterprise systems. 3.1. Application Architecture In Java EE, applications are divided into four teirs: Enterprise Information System (EIS) tier, business tier, web tier, and client tier. 3.1.1. EIS Tier The Enterprise information system tier contains the enterprise information system server that contains the data of the application. It is usually the Relational DBMS. 3.1.2 Business Tier The Business tier contains business components where business logic is 2 implemented. 6
  • 7. 3.1.3 Web Tier 3 The web tier contains web components that generate dynamic web pages over hyper text transfer protocol (HTTP). Pages are accessed using the web browser, that's known in Java EE as the thin client. 3.1.4 Client Tier The client tier access system services. There are two variations of the client tier: 1. Swing Application: in case the client access the business components. 2. Web Browser: in case the client access the web components. 3.2. Application Design In Java EE, applications are developed using a component-based model. The Java EE platform provides different types of components that can be developed and deployed on the application server. We will study two different types of components: business components and web components. 3.2.1 Business Components Business components (known as: Enterprise JavaBeans, or EJB in short) are developed to implement business logic. EJBs are standard components that can be 4 accessed remotely using RMI . There're two types of EJBs: - Session Beans. - Message-Driven Beans. 3.2.2 Web Components Web components are responsible for generating web pages and documents. There're two types of Web components: - Servlets. - JSPs (JavaServer Pages). 2. Business logic includes processing data for operations like accounting, inventory, HR management, and so on. 3. Web pages are usually HTML pages that are either static or dynamic. In case of static web pages, content does not change and every time the browser visits the page it receives the same content. Dynamic pages however, are created dynamically when the browser request the page. The page is generated dynamically and the browser may receives different content each time it visits the page. 4. Remote Method Invocation: a Java API for implementing remote procedure calls (RPCs). 7
  • 8. 5 There are significant differences between Plain Old Java Objects (POJOS) and Java EE components: - Components are standardized. Java EE components should implement certain interfaces, extend some class, or following any other standard required by the specification to be certified as a component in Java EE platform. Unlike POJOs, classes should not follow any certain standard requirement. - Components are managed by the Java EE Application Server. Enterprise applications do not run by themselves as standalone applications, instead, they should run in a managed environment provided by the Java EE application server. Thus, components are developed and compiled, then deployed on the Java EE application server. Application server then runs them in its managed environment. Unlike POJOs, where we used to run the class with the main() method. In other words, Java EE applications does not have main() method. In addition, components are not accessed directly. The client tier access components using standard interfaces. Unlike POJOs, where we used to access the object directly using its reference. In other words, the application server acts as a service layer between the client tier and other tiers. - Components are not instantiated using new operator. In distributed systems, components are not accessed directly. Instead, component are named and located. When the developer deploys a component on the application server, she gives the component a unique name. The client then asks the application server to locate the component, and instantiate it for him, using its name. In other words, the client does not instantiate the component, but the application server is responsible for instantiating and returning a reference to the component for the sake of the client. - All components are developed for the sake of the client. Take in concentration that the ultimate purpose of Java EE is to develop distributed multi-tiered applications. Thus, all components are developed and deployed to provide a service that's actually used by a consumer, the client. Every EE application we are going to develop will has clients to access our developed system. Either we will develop the client ourselves in case of Swing Application clients, or the client will be the web browser in case of accessing web components. 5. The ordinary java objects we used to develop and use in Java SE applications. 8
  • 9. 4. The Java EE Application Server The Java EE application server is a specification by Sun Microsystems that describes a middleware system. The system should provide a managed environment for Java EE components, in addition to an implementation to the Java EE APIs. Java EE APIs are a specification, as well. Any system that implements the Java EE application server and Java EE APIs specification is called Java EE application server, or application server in short. In fact, any vendor can implement the specification, but should get certified first by Sun that her implemntation is a valid application server. There are dozens of application servers in the market. Here is a list of some application servers and their vendors: Application Server Vendor Type Glassfish Sun Open Source/Free JBoss RedHat Open Source/Free Edition WebSphere IBM Open Source/Free Edition OC4J ORACLE Commercial We will use JBoss application server, that can be downloaded from: http://www.jboss.org/. Your role, as the application developer, is to only develop Java EE components according to the specification, then deploy them on the application server. Since both the components and application servers are developed according to the specification, any Java EE application can run on any Java EE application server, which is the sexiest property of the Java EE platform. 4.1. Runtime The application server provides the runtime platform in the form of containers. A container is a component of the application server that manages a specific type of components and provide them with all the needed services and Java EE API implementaiton. We will study two types of containers: - Business Container The business container is responsible for managing business components and providing them with runtime services like: RMI communication, database manipulation, transaction services, etc. - Web Container The web container is responsible for managing web components and providing them with runtime services like: HTTP communication, database manipulation, etc. 9
  • 10. 4.2. Services The application server provides each container with a set of required services. The service is implemented and supported to the application developer via Java EE APIs. Services include: - Remote Method Invocation (RMI). - HTTP (Hypertext transfer protocol). - HTTPs (HTTP over SSL). - Java Messaging Service (JMS). Supported via JMS APIs. - Java Naming and Directory Interface. Supported via JNDI APIs. - Distributed Transactions Management. Supported via Java Transactions APIs (JTA). - Java Database Connectivity. Supported via JDBC APIs. - Persistence. Supported via Java Persistence API (JPA). - Java Authentication and Authorization Service (JAAS). 4.3. Final Image - Java EE Architecture 10