Upload
saurabhshertukde
View
947
Download
1
Tags:
Embed Size (px)
Citation preview
Introduction
to
J2EE
2
Enterprise Architecture types
Enterprise Architecture can be broken into 3 fundamental layers
• User Interface• Processing• Data Storage and access
3
Types of enterprise architecture
1. Single Tier
All 3 layers of enterprise architecture exist on the same system
2.Two Tier Architecture
- All 3 layers distributed between 2 tiers
- Generally UI and business logic reside on FE and Data Access on Back end
4
3. Three tier architecture
- All 3 layers separated logically
- Physical separation depends on the application
- User Interface- client end
Processing – Middle / Business Tier(Apps server)
Database - Back end
5
4. n.Tier Architecture
- 2nd layer can be broken into multiple layers
User Interface
Business model
Business rules
Business object to data source mapping
Data Access
6
Advantages of n tier1. Improved maintainablity : Applications can
be easily maintained
2. Consistency: In terms of component design
3. Interoperability: Supports component design in any layer and by any technology
4. Flexibility : Freedom to design any type of component
5. Scalability: Addition of new components…
7
Goals of an Enterprise Architecture• Robust• Performance & Scalability• Capitalize adv of OO Design Priniciple• Avoid complexity• Maintainable and Extensible• Ease of testing• Reuse of application• Support multiple client types• Product delivery on time
8
What is J2EE??
• Platform used for n tier application development
• Compliant with goals of enterprise architecture
• Based on Java 2 Platform , standard edition
9
Benefits of J2EE1. Simple Architecture
- Provision of a variety of ways to configure architecture of an application
- supports component based design
( updation, replacement and addition of new functionality can be wired into existing app easily)
( Member with specific skill set develops components under his/her skill area leading to developmental modularization)
10
2. Easy association with existing Information system
- includes industry accepted APIs thereby enabling to access existing Information systems(J2SE based systems)
- Wiring to existing system through
a) J2EE connector architecture
b) JDBC API
c) JNDI
d) Java Mail
11
3. Freedom of server ,tool and component choice
- Organisations have plethora of choices in terms of vendors, hardware, OS,server configuration.( This has created market for servers for J2EE platform)
- Component support ensures standardized, packged and reused components.Vendors will be able to provide solutions which will be easily compatible to the current system.
12
4. Scalabilty
- component design support has improved the scalabilty factor in these application
5. Security model
- EJB and Servlet provide programmatic security mechanisms
- user based security offered by application at deployment time
13
Features of JEE• Platform Independence
• Managed Objects through containers
• Reusability
• Modularity
• Easy development
• Simplified EJB technology
• Enhanced Web services
• Support for web2.0
• Ease of Application packaging
• Light weight JPA(POJO based)
14
JEE Runtime Infrastructure
15
• Run time infrastructure is used for managing and hosting applications
• Services to manage applications are provided by runtime infrastructure.(platform level)
• Services- messaging,security and distributed transactions
• JEE accesses the APIs that provide services through containers
• J2SE provides core APIs for devloping a JEE application
16
APIs in JEE1. Enterprise Java Beans (EJB3.0)
- Server side code for business logic
- types – session beans & message driven beans
- Session bean – conversation with client
- message driven bean – session bean + message
listener(asynchronous)
- Entity beans have been replaced by JPA.
17
2. Java Servlet Technology 2.5
- Extends the capability of servers
- Commonly used to extend applications hosted by Web servers
3. Java Server Pages Technology 2.1
- Text document – HTML+WML+JSP elements
- Construction of Dynamic content
18
4. Java Server Pages Standard Tag Library 1.1
- JSTL
- Provides standard set of JSP tags instead of mixing multiple tags by multiple vendors
- iterator and Conditional tags – control flow in XML documents
- Database access tags using SQL
- Uses JSP container
19
5. Java Server Faces 1.2
- Simplifies UI build process
- server side UI building framework
- Provides a set of reusable UIs from which new UIs cn be constructed.
6. Java Message Servics 1.1
- JMS
- Componnts to send , receive and read Messages
- Lossely coupled and Asynchronous.
20
7.Java Transaction API1.1
- JTA – interface for transactions
- default auto commit and rollbacks
8. Java mail 1.4
- email notifications
- 2 types – application level interface & Service provider level interface
- Java mail + service provider= Internet email
21
9. JavaBeans Activation Framework1.1
- JAF
- provides service for
data identification
access encapsulation
operation identification
JavaBean creation for identification
22
10. Java API for XML processing1.4(JAXP)
- Supports XML document processing using DOM,Simple API for XML,
and Extensible style sheet Language Transformation(XSLT).
11. Java API for XML web services(JAX-WS)
-provides web services
12. Java Architecture for XML binding(JAXB)
- convienient bind between XML schema and Java language programs
23
13. SOAP with attachments API (SAAJ)
- Standard way to send XML documents over internet.
14. Streaming API for XML(StAX)
- Alternative to DOM,Simple API for XML, TrAX .
15. Java API for XML registeries(JAXR)
- provides access to business and general purpose regiters over web
24
16. J2EE Connector Architecture
- Provides solutions for connectivity between Application servers and EIS.
17. JDBC API
- Supports SQL commands in Java programing language
18. Java Persistence API (JPA)
- Uses ORM approach to bridge gap between Object oriented model and
Relational database
25
19. Java Naming and Directory Interface(JNDI)
- provides naming and directory functionality
- enables access to multiple naming and directory services
20. Java Authentication and Authorization(JAAS)
- Authenticates and Authorizes users for JEE application.
26
Architecture of JEE 5
Client M/c
JEE Server
Data BaSe Server Server
Client Tier App
Client
HTML
Pages
Web Tier
Business Tier
JSP
EJB EJB
EIS Tier
27
Java EE Containers
• JEE provides services in the form of a container for every component
• Containers are interfaces between components and Low level platform specific functionality
• Components should be deployed in the container before use.
28
Container Types
1.EJB Container
- provides an environment in which one or more Enterprise bean will run
- Combination of classes and interfaces
- Provides EJB component with
lifecycle , state management , naming services, security mechanisms and persistence management.
29
2. Web Container
- Manages JSP and Servlet
- Runtime environment for web application
- Web container is always in a web server
- provides context and lifecycle management
3. Application client Container
- Manages execution of application client components.
4. Applet Conatainer
- Manages the lifecycle of applets
30
Developing Java EE 5 ApplicationSteps to develop a JEE application are
1. Develop application component
2. Compose application components into modules
3. Compose modules into application
4. Deploy application
31
Developing Application component
- All the functional units (components) are designed in this phase
- component – a class / collection of classes and interfaces
- 5 types of components
EJB,servlets, JSP , applets, application client, connectors.
-
32
Compose application components into modules
- process of bundling/wiring of components
-3 types of modules can be designed
1. EJB module-
-packaged and deployed as ejb-jar.xml
- contains class files for ejbs,deployment descriptor
- may contain classes and interfaces for ejbs not included in J2EE platform
33
2. Web module-
- Packaged and deployed in web.xml file
- Contains class for servlets,JSP,Static documents , class for applet, web
deployment descriptor.
3. Application client module
- Packaged into jar files
- Contains class for client, application client deployment descriptor
34
3. Composition of modules into application
- Java EE application is delivered as enterprise archive(ear) file.
- JEE application packages the modules and their corresponding deployment descriptors.
- application.xml is required as deployment descriptor of the entire application
35
JEE application (ear file)
application.xml
Ejb module Web module Java module
Ejb module (jar)
Ejb-jar.xml
ejb
ejb
Web module (jar)
web.xml
jsp
servlet
Java module (jar)
Application client.xml
Java
Java
36
4. Application Deployment
- Involves 2 steps
1. Installation of the application – the deployer copies the ear to the application server , generates additional container specific classes and interfaces
2. Configuration of the application- resolves all external dependencies and follow the application assembly instruction
37
Probable Architectures
• Applet Client with JSP and Database
presentation – Applet
Business - JSP
Database - JDBC• Application Client with EJB
presentation – JFC/Console application
Business - EJB
Database - JDBC
38
• JSP Client with EJB
presentation – Web Browser
Web tier - JSP
Business - EJB
Database - JDBC• Web Services for application integration
presentation – C# application
Web tier - Web Services
Business - EJB
Database - JDBC