Technologies of J2EE by pengxiuhui

VIEWS: 14 PAGES: 38

									Session 2

      Technologies of J2EE
    Review
 Traditional enterprise application providers have changed over
  from 2-tier, client-server application models to three-tier
  application models.
 The rapid development of this new model was fuelled by the
  introduction of various middleware services.
 A developer is usually faced with a range of problems while
  developing an enterprise-wide application.
 The different problem domains include:
   • Programming productivity
   • Response to demand
   • Integration with existing systems
   • Freedom to choose
   • Maintaining security
 The mission of J2EE is to provide a platform-independent, portable,
  multi-user, secure and standard enterprise-class platform for
  server-side deployments written in the Java language.
                                                   Overview of J2EE/Session 2/Slide 2 of 38
    Review Contd…
   The J2EE specifications include those to:
     • Design the enterprise application
     • Distribute Roles to people involved in developing the
       software (Project/Product) i.e. J2EE specifies the
       rules of engagement that people must agree on
       when writing enterprise software
     • Bundle the files to the clientProgramming
       productivity
     • Standardize the technologies that could be used in
       J2EE
     • Standardize the interaction between the different
       technologies                          Overview of J2EE/Session 2/Slide 3 of 38
       Review Contd…
   The various J2EE components include:
     •  Application components
     •  Containers
     •  Resource manager drivers
     •  Databases
   The J2EE platform communicates with the outside world in different
    ways. These ways, known as contracts, are well defined, and
    separated into:
     •  APIs
     •  Network protocols
     •  Deployment descriptors
   One of the most important concepts in J2EE is a platform role. The
    J2EE standard provides separation between different roles, so that
    different players in the market can specialize in their role. These roles
    include:
     •  J2EE Product Provider
                                                          Overview of J2EE/Session 2/Slide 4 of 38
     •  Application Component Provider
      Review Contd…
   One of the most important concepts in J2EE is a platform role. The
    J2EE standard provides separation between different roles, so that
    different players in the market can specialize in their role. These roles
    include:
     •  J2EE Product Provider
     •  Application Component Provider
     •  Application Assembler
     •  Deployer
     •  System Administrator
     •  Tool Provider
   The J2EE Platform provides several benefits such as:
     •  Simplified architecture and development
     •  Integrating existing enterprise information systems
     •  Scaling
     •  Security
                                                         Overview of J2EE/Session 2/Slide 5 of 38
    The Objectives…
   Describe the various technologies involved in
    J2EE
   Explain the component technologies
   Discuss the service technologies
   Describe the communication technologies




                                      Overview of J2EE/Session 2/Slide 6 of 38
       J2EE Technologies categories


              Component                            Communication
              Technologies                          Technologies


                                Java
                             Transaction
HTML                                                    RMI
                                 API
              Servlets
Client-side                    Service
Technology                   Technologies
                                            Overview of J2EE/Session 2/Slide 7 of 38
Overview of J2EE/Session 2/Slide 8 of 38
Component Technologies




                   Overview of J2EE/Session 2/Slide 9 of 38
           Servlets
          Server
                                   Server-side programs
                                   No interface
                                   Form basic building blocks of web
                                    applications
                       Client      Provide the means to extend and
                                    enhance web servers
                                   Can be used to generate dynamic
                                    content
Servlet

              Applet
                                                      Overview of J2EE/Session 2/Slide 10 of 38
           JSP (Java Server Pages)
           Server
                                     Extension of servlet technology
       Web
                                     Created to support authoring of
      Server
               Servlet invoked        HTML and XML pages
                                     Easier than servlets to combine
                                      static data with dynamic content
  JSP Compiled by web server         More suited for separating
                                      application logic from presentation
                                      logic
                    Result Returned

JSP
                     Client

                                                         Overview of J2EE/Session 2/Slide 11 of 38
          Enterprise JavaBeans
              Server                       Used to develop
                                            business logic
                                           Allow separation of app
                 Middle Tier                logic from system level
                                            services
                       -----
                       -----               To use services
Application
                       -----
                                            provided by J2EE,
logic          -----
               -----                        business components
                                            are implemented by EJB
               -----




                                            components/Enterprise
   System
   level
                                            beans
   services                    Client
                                                     Overview of J2EE/Session 2/Slide 12 of 38
             Enterprise Beans
              Session Beans                                 Entity Beans
   Used exclusively by clients                                       Bean
   that created them
                                                         Data

Stateful                       Stateless
                                            Client                • Wrapper for
                                                                    data easing
                                               Client               access to data
                                                        Client
                                                                  • Instance of
                                                                    bean can be
    Client                   Client                                 shared by
                                                                    multiple clients
Exists as long as      Persists only as
session exists         long as request is
                                                                 Overview of J2EE/Session 2/Slide 13 of 38
                       being processed
  Service Technologies
SERVICES



                Generally, containers take care of
                 required J2EE services for components
Components      Developer focuses on business logic
                Sometimes services may need to be
 Develops        explicitly called



 Developer
                                       Overview of J2EE/Session 2/Slide 14 of 38
       JDBC                    Relational
                                  Database


       JDBC                 J2EE adds extension to core API of
                             J2SE
                            API has generic methods to access
                             databases
                            Core API: classes and interfaces
SERVICES                     packaged into java.sql package
              JDBC 2.X
                API         Optional Package: javax.sql package




                                                   Overview of J2EE/Session 2/Slide 15 of 38
    Java Transaction API & Service
Components of Distributed Transaction System


 Resource        Application   Transactional
 Manager           Server       Applications


                                          Java Transaction Service
      Java Transaction API                specifies the implementation
                                          of the Transaction Manager
                                    Most important component in a transaction
                                    processing environment
              Transaction
               Manager              Creates transactions requested by
                                    components, and performs 2-phase commit
                                                           Resource Managers
                                    recovery protocol with Overview of J2EE/Session 2/Slide 16 of 38
 Transactions                 Database




TRANSACTION


--------
-------         tomic
-------
-------
                onsistent
 Group of
 operations
 performed      solated
 on data

                urable      Overview of J2EE/Session 2/Slide 17 of 38
Request sent to Transaction
Manager to initiate transaction



Transaction Manager starts transaction & associates it
with thread that initiated the process



Transaction Manager creates transactional context -
which is shared by all relevant components & threads



Thread issues commit or rollback
request

                                            Overview of J2EE/Session 2/Slide 18 of 38
JNDI

                                                             Client
     objectName
                      Object is invoked by name




Object

                                                             Client
     objectName
                       Object is invoked by name
         Attributes          and attributes
               ---
               ---
               ---

Object                                             Overview of J2EE/Session 2/Slide 19 of 38
Directory and Naming Service

                                                                Client
     objectName
                          Object is invoked by name




Object
                      Directory services use proprietary protocol
                                                                Client
     objectName
                             Therefore, interoperability
                           Object is invoked by name                     difficult
         Attributes              and attributes
               ---
               ---
               ---

Object                                                Overview of J2EE/Session 2/Slide 20 of 38
Communication Technologies



   Communication
    Technologies


                                      Component

                                      Service
                   Overview of J2EE/Session 2/Slide 21 of 38
     Internet Protocols


          Sends                Server
         request




                   Results
                    sent
                             Web-based, distributed,
                             enterprise applications
                             scenario
Client
                                        Overview of J2EE/Session 2/Slide 22 of 38
HTTP
   Set of rules for exchanging files on the World
    Wide Web




                                     Overview of J2EE/Session 2/Slide 23 of 38
         TCP/IP
IP picks up packets, and
ensures that they reach
destination.
TCP tracks the
packets


                           Internet                                   TCP assembles
                                                                      packets after
                                                                      checking for
                                                                      errors, missed
                                                                      packets etc.




                     TCP breaks up data into packets

                                                       Overview of J2EE/Session 2/Slide 24 of 38
       SSL


                    Encrypted data
                      transmitted


SSL

Data



        Encrypted Data               Overview of J2EE/Session 2/Slide 25 of 38
        RMI
                       Remote
           Remote       Java
         Java Object   Object



                             Remote
                           Java Object




                        RMI-IIOP brings CORBA’s distributed
                        computing abilities to the Java
Client invoking         platform. Therefore, best features of
methods of remote       RMI and CORBA are combined.
Java objects
                                              Overview of J2EE/Session 2/Slide 26 of 38
Java IDL
   Object Request Broker available with
    JDK 1.2
   Classes and libraries available in the IDL
    allow Java clients to access methods of
    CORBA objects.




                                 Overview of J2EE/Session 2/Slide 27 of 38
     JMS
                                      component
      component



                        JMS                 component
                  and other technologies

  component
                               component


Provides reliable, asynchronous communication
between components in a Distributed Computing
Environment                                   Overview of J2EE/Session 2/Slide 28 of 38
   Java Mail



            JavaMail

Used to exchange messages between users
Supports SMTP, POP, IMAP4
Slower than JMS                     Overview of J2EE/Session 2/Slide 29 of 38
XML
              For distributing structured
             information over the Internet
              Data interchange format in web-
             based applications--
      XML



  Internet
             XML


                               Overview of J2EE/Session 2/Slide 30 of 38
        The Power of XML
                                  Changes are updated to
                                  2 different databases

SQL Server        XML                                                 Oracle
             ------
 Database    -----                                                   Database
             -----
             -----
                        Appropriate
                        presentation      XML                          XML
                        style applied


Same data can be presented in
a variety of ways, to a variety
of devices                                         Overview of J2EE/Session 2/Slide 31 of 38
            HTML                           XML
                 Fixed predefined tags   Tags defined by developer
    ----                                                                                   ----
    ----                                                                                   ----
    ----         Handles content &              Handles ONLY content                       ----
                 presentation




           CSS
Can be optionally
used to take care of                                     Transforms XML by
presentation                                             applying styles to it


 Browser interprets HTML code
                                                           Overview of J2EE/Session 2/Slide 32 of 38
        XML Documents can be…
              Well-Formed             Valid

 ----
 ----
                                          Specifies types to
 ----            XML                  DTD be used in the
              Specification               XML document
                by W3C


                  -----------------   -----------------
                  -----------------   -----------------
                  -----------------   -----------------
XML adheres       -----------------   -----------------
                                                                XML conforms
to syntax rules                                                 to the DTD
                                                          Overview of J2EE/Session 2/Slide 33 of 38
J2EE Technologies




                    Overview of J2EE/Session 2/Slide 34 of 38
    Summary
   The J2EE technologies can be broadly classified into
    four different categories:
       Client-side technologies
       Component technologies
       Service technologies
       Communication technologies
   Component technologies include:
       Servlets
       Java Server Pages
       Enterprise JavaBeans
            Session Beans
            Entity Beans

                                           Overview of J2EE/Session 2/Slide 35 of 38
    Summary
   Service Technologies include:
       Java Database Connectivity
       Java Transaction API and Service
       Java Naming and Directory Interface
   Transaction - A transaction is a group of operations
    that are carried out as a single unit on records stored
    in a database. The group must have a set of
    characteristics in order to be considered as
    transactional.
   ACID properties include
       Atomic
       Consistent
       Isolated
       Durable                               Overview of J2EE/Session 2/Slide 36 of 38
    Summary Contd...
 The Java Naming and Directory Interface, JNDI in
    short, is a naming service.
   A naming service associates a name with an object,
    so that clients can locate the object using the
    specified name.
   A directory service on the other hand, allows
    attributes as well as names to be associated with
    objects.
   Internet Protocols include:
       HTTP
       TCP/IP
       SSL

                                          Overview of J2EE/Session 2/Slide 37 of 38
    Summary Contd...
   Remote Object Protocols include:
       RMI and RMI-IIOP
       Java IDL
       JMS
       JavaMail
   XML or Extensible Markup Language is the most
    popular tool to distribute structured information over
    the Internet.
   XML is used for structured information management.
   XML can also be used to create customized views of
    data .
    XML documents come in two flavors – well formed
    and valid.
   J2EE deployment descriptors are written in XML
    based on predefined DTDs                 Overview of J2EE/Session 2/Slide 38 of 38

								
To top