J2EE - ENTERPRISE DEVELOPMENT AND INTEROPERABILITY WITH NON-J2EE

Document Sample
J2EE - ENTERPRISE DEVELOPMENT AND INTEROPERABILITY WITH NON-J2EE Powered By Docstoc
					   J2EE - ENTERPRISE DEVELOPMENT AND
 INTEROPERABILITY WITH NON-J2EE CLIENTS

                     presented by
   Sudha Balla, Betsy Cherian and Lance Fiondella

                   Semester Project
CSE333 – Distributed Component Systems (FALL 2002)

                     Instructor
            Prof. Steven A. Demurjian
   Department of Computer Science and Engineering
              University of Connecticut
             ballasudha@engr.uconn.edu
               Betsy@engr.uconn.edu
               fiondella@gtemail.net


                                                    J2EE--1
          Organization of presentation
1.   Introduction and Motivation(Lance)
2.   Server-side component architectures(Sudha)
3.   J2EE Platform overview(Lance)
4.   J2EE Standardized Services(Betsy)
5.   EJB/CORBA(Sudha)
6.   J2EE Patterns(Betsy)
7.   The Department of Motor Vehicles Prototype(Sudha)
8.   Conclusion(Sudha)




                                                         J2EE--2
          Introduction - Assessment
   Java has been around for over 7 years now.
   Server-side component architectures
   Microsoft’s .NET product
   Sun Microsystems’ Java2 Platform Enterprise
    Edition (J2EE) standard
   Object Management Group’s CORBA standard




                                              J2EE--3
            Introduction - Benefits
   Enterprise JavaBeans includes both Java/RMI and
    RMI – IIOP as middleware options.
   Sun and OMG support EJB/CORBA interoperability
    and have produced standards for the same.
   The EJB/CORBA mapping specification and RMI-
    IIOP relieve EJB from being restricted to the Java
    platform, enabling EJB components to be exposed as
    CORBA objects making them well suited for cross-
    language interoperability.




                                                  J2EE--4
J2EE--5
              Motivation – SE to EE
   Large organizations utilize J2EE.




                                        J2EE--6
Motivation - …




                 J2EE--7
    Motivation – Academic perspective
   Maintain an objective research perspective on the
    state of development of Java2 Enterprise Edition
    and Java technologies in general.
   Determine the role Java plays as an educational
    language, problem-solving skill for the workplace,
    and research tool for academia.
   Focus on the classical facilities provides insight
    into the true maturation of Java.




                                                  J2EE--8
    Server-side Component Architectures
                 (Overview)
   Issues surrounding server-side development
   The need for standardized architecture
   Popular server-side architecture standards
   Similarities and differences between J2EE and
    other competing technologies
   Enterprise Application Development and these
    technologies




                                                    J2EE--9
    Server-side Component Architectures
             (Software Components)
   What are software components?
   What is a component architecture?
   Divide-and-conquer approach and its advantages
     Saves development and deployment time
     Services could be simply outsourced
     Users save time by buying instead of building
     Deployment is strengthened as the common
       products are developed by domain experts




                                                 J2EE--10
    Server-side Component Architectures
            (Server-side Components)
   What is a server-side deployment?
   Logical layers in the deployment
      Presentation Layer
      Business logic Layer
      Data Layer
   Layers are pure abstractions and may or may not
    correspond to physical distribution
   a N-tier architecture deployment is one where there
    is a physical separation between each of the layers
   Each of the layers could further be decomposed to
    allow various parts of the system to scale
    independently

                                                  J2EE--11
Server-side Component Architectures
(Three-tier Web-based Application Architecture)
                                                           I
                                                           n
                                                           s
                                            Presentation   e
          WEB SERVER                           layer       c
                                                           u
                                                           r
                                                           e
                     Firewall + tier boundary



       APPLICATION SERVER               Business logic     S
        WITH COMPONENT                      Layer          e
           CONTAINER
                                                           c
                                                           u
                                                           r
                                                           e
                            tier boundary                  z
                                                           o
                                                           n
                                             Data layer    e

               Database


                                                               J2EE--12
   Server-side Component Architectures
             (N-Tier Architectures)
PRO:
 Deployment costs are low
 Database switching costs are low
 Low costs in business logic migration
 Securing deployments using firewalls is possible
 Resource pooling is possible
 Performance slowdown is localized
 Errors are localized
CON:
 Communication performance suffers
 Maintenance costs are high



                                                J2EE--13
    Server-side Component Architectures
         (Demands of a multi-tier deployment)
   Handle lifecycle of the components
   Perform resource pooling
   Broker method requests
   Handle the logic to load-balance communications
    between each tier
   Deal with ramifications of two or more clients
    concurrently accessing the same component
   Reroute client requests to other machines in case of
    failure
   Provide secure environment and deal with
    unauthorized accesses
    APPLICATION SERVERS WERE BORN AS A
             SOLUTION TO THESE ISSUES
                                                   J2EE--14
    Server-side Component Architectures
             (Role of Application Servers)
   provide the middleware services
   allow enterprises buy the services
   aid in rapid the application development

Anomalies and problems:
 Vendor specific middleware services
 Once an application sever is chosen the code is
  locked to that particular vendor’s solution
 Reduces portability
 Hampers commerce of components




                                                    J2EE--15
    Server-side Component Architectures
                 (Need for a standard)
   The standard would describe a well-formed
    interface between the application server and the
    components themselves
   Components could be managed in a portable way
   Components could be switched between various
    application servers
   Component vendors could be relieved of issues
    about external overhead such as resource pooling,
    networking, security etc.
   Necessary elements of enterprise-class
    deployments are externalized to application server
    vendors, providing common services to all
    component developers
                                                   J2EE--16
    Server-side Component Architectures
                    (Standards)
   OMG’s CORBA Standard
   Sun Microsystem’s J2EE Standard
   Microsoft’s .NET Architecture




                                      J2EE--17
Server-side Component Architectures
       (Standards – J2EE vs .NET)

       Java Client Application    Business System            Web Client


                                  Container

                                              Servlets and JSPs

                                    EJBs



                                    Connectors




             Legacy Systems or Databases or Other Business Systems




          The J2EE Server-side Architecture


                                                                          J2EE--18
Server-side Component Architectures
       (Standards – J2EE vs .NET)


       Business System      Rich Client Application        Web Client


                                   Container

                                   ASP.NET

                          .Net Managed Components


                                       Host
                                    Integration
                                    Server 2000




             Legacy Systems or Databases or Other Business Systems




          The .NET Server-side Architecture


                                                                        J2EE--19
    Server-side Component Architectures
                (Standards – J2EE vs .NET)
J2EE was found advantageous over .NET:

   a proven platform while .NET is a rewrite of Microsoft’s previous
    technologies and introduces risk as with any first-generation
    technology

   lets enterprises take advantage of existing hardware they may
    have

   gives platform neutrality, including Windows and good portability

   has a better legacy integration through the Java Connector
    Architecture (JCA)

   lets the use of any operating system enterprises prefer, such as
    Windows, UNIX, or mainframe


                                                                J2EE--20
J2EE Platform Overview - Environment




                                  J2EE--21
 J2EE Platform Overview -
Components and Containers




                            J2EE--22
J2EE--23
         J2EE Platform Overview –
        Java Servlet Technology(1)
   Mechanism for generating dynamic web content.
   They may be thought of as Java applets for
    servers.
   platform independent, pleasant user interfaces,
    better performance due to persistent well-defined
    API for flexibility.




                                                  J2EE--24
         J2EE Platform Overview –
        Java Servlet Technology(2)
   Web browser  HTTP request  web server
   Web server  gives request to servlet container
    gives request to specific servlet
   Servlet receives request object.
   Servlet processes. (may return a response object)
   During process, servlet may use a context object to
    save information usable by other servlets, and
    read a session object to determine a client state.




                                                  J2EE--25
        J2EE Platform Overview –
          JavaServer Pages(1)
   Utilize Java Servlet technology to simplify well
    organized dynamic web content.
   JSP pages define the static HTML template, and
    embeds invocations to Java code.
   Useful and routine operations like embedding
    dynamic distributed database queries and
    generation of their associated reports.
   Hides the complexity of programming in Java
    from the page designer




                                                 J2EE--26
    Enterprise JavaBean Components(1)
   A server-side technology for developing and
    deploying components containing the business
    logic of an enterprise application.
   Allows encapsulation of legacy technologies.
   EJB is a client-neutral standard.




                                                   J2EE--27
    Enterprise JavaBean Components –
                Entity Beans
   Represent persistent objects like database entries.
   EJB specification indicates that a bean and its
    references survive a crash of its container.
    (achieved by storing the state in the database or
    through serialization)
   Container provides a class in order to provide
    meta-data to the client.




                                                   J2EE--28
    Enterprise JavaBean Components -
         Message-Driven Beans
   A basis for constructing loosely coupled
    applications capable of communicating indirectly
    using the queuing and subscription models
    supported by JMS.
   More flexible and realistic for heavily congested
    networks.




                                                  J2EE--29
    Enterprise JavaBean Components -
              Session Beans
   Limited lifetime as the name suggests
   If stateless won’t preserve state between calls
   Saving and restoring state are properties of stateful
    session beans




                                                    J2EE--30
J2EE Technology Suite




                        J2EE--31
          J2EE Standardized Services
   The containers supporting the J2EE components provide
    three types of services :
      Communication
           RMI-IIOP
           Java IDL
           JMS
           Java Mail
       Enterprise
           JDBC
           JTA
           JNDI
           JCA
       Internet
           HTTP
           TCP/IP
           SSL
           XML

                                                       J2EE--32
           Communication Services
   JavaIDL, RMI-IIOP
      Allows objects written in Java to to invoke
       CORBA objects using IIOP. Provides
       interoperability with CORBA objects.
   JMS
      API for asynchronous messaging
   JavaMail:
      Provides an API for electronic mail




                                                     J2EE--33
              Enterprise Services
   JDBC
      API for DB independent connectivity between
       J2EE and other datasources
   JTA
      The transaction API for J2EE which guarantees
       transactional integrity
   JNDI
      Provides a naming environment, & facilitates
       directory operations
   JCA
      Mandatory with v.1.3 of J2EE. Helps to
       integrate different EJB containers with
       different EIS.
                                               J2EE--34
                Internet Services
   For access to Internet services, J2EE supports the
    following protocols:
      TCP/IP
      HTTP
      SSL
   XML
      J2EE v.1.3. supports XML functionality.




                                                   J2EE--35
EJB – CORBA INTEROPERABILITY
                   (Overview)
   how EJB and CORBA complement each other
   where EJB gets its edge over CORBA
   where CORBA would be still depended on
   benefits of EJB / CORBA interoperability
   interoperability scenarios




                                               J2EE--36
EJB – CORBA INTEROPERABILITY
                (CORBA Overview)


       CLIENT                             CORBA Object
                                          Implementation


          CORBA Object Interface




     CORBA Stub                           CORBA Skeleton




        ORB                                    ORB



                       Network via IIOP

                  CORBA Architecture

                                                           J2EE--37
EJB – CORBA INTEROPERABILITY
               (CORBA Services)
   COS Naming
   CORBA Event Service
   Object Transaction Service (OTS)
   Concurrency Control Service
   Security Service




                                       J2EE--38
 EJB – CORBA INTEROPERABILITY
                   (CORBA)
Advantages:
 not controlled by one organization
 language-independent


Disadvantages:
 Slow-moving
 Steep learning curve




                                       J2EE--39
EJB – CORBA INTEROPERABILITY
          (OMG’s CCM Specification)
   adds component features to CORBA objects
   similar to EJBs
   intention that CORBA components and EJBs
    can reside together
   a CORBA component could appear as if it
    were an EJB
   an EJB could appear as if it were a CORBA
    component




                                          J2EE--40
EJB – CORBA INTEROPERABILITY
      (Why is CORBA important for EJBs?)
   Legacy Integration
   Advanced middleware services
   EJBs exposed to CORBA clients (the
    highlight of this interoperability section)




                                                  J2EE--41
EJB – CORBA INTEROPERABILITY
                  (RMI and IIOP)
   Remote Method Invocation(RMI) is a
    communications package for performing
    distributed computing in Java
   default protocol layer for communication used
    by RMI is Java Remote Method
    Protocol(JRMP)
   CORBA uses Internet Inter-ORB
    Protocol(IIOP) as its default protocol layer for
    communications
   RMI and CORBA are very similar
    technologies


                                                J2EE--42
    EJB – CORBA INTEROPERABILITY
                   (RMI and CORBA)
Problems:
    RMI - built specifically for Java and CORBA – built to
     allow language interoperability
    two technologies are highly incompatible
    major portion of a program coded for the RMI API
     needs to be rewritten if there is a need to switch to
     CORBA and vice versa
    prohibits code reuse
Ideal Scenarios:
    Combine client-side Java RMI with server-side
     CORBA
    Combine client-side CORBA with server-side Java
     RMI
       Need: bridge between RMI and CORBA
              Solution: RMI over IIOP

                                                       J2EE--43
EJB – CORBA INTEROPERABILITY
         (RMI and CORBA – Ideal Scenarios)

RMI CLIENT                     CORBA Object     CORBA CLIENT                      RMI Object
                               Implementation                                   Implementation


      RMI Remote                                     CORBA Object
     Object Interface                                    Interface


 RMI Stub                      CORBA Skeleton                                   RMI Skeleton
                                                CORBA Stub




   ORB                              ORB            ORB                               ORB



            Network via IIOP                                 Network via IIOP


             Scenario #1                                 Scenario #2

                                                                                                 J2EE--44
    EJB – CORBA INTEROPERABILITY
                     (RMI over IIOP)
    unification of RMI and CORBA
    RMI run over IIOP (instead of JRMP)
    delivers CORBA distributed computing capabilities to the
     Java2 platform
    speeds distributed application development completely in
     Java
    code reusability of programs coded with the RMI API and
     the CORBA API
    lessens the impact of switching between the two
     technologies
    IIOP eases legacy application and platform integration
    IIOP makes RMI more robust



                                                         J2EE--45
    EJB – CORBA INTEROPERABILITY
            (RMI over IIOP : Combinations)
CLIENT                          SERVER

    RMI client with RMI-IIOP      RMI Server with RMI-IIOP
     Stub                           skeleton

    RMI client with RMI-IIOP      CORBA object implementation
     Stub

    CORBA client                  RMI Server with RMI-IIOP
                                    skeleton

    CORBA client                  CORBA object implementation




                                                          J2EE--46
    EJB – CORBA INTEROPERABILITY
                    (EJB Specification)
    EJB components must be able to run over both
     RMI and RMI-IIOP
    RMI-IIOP as an on-the-wire protocol for EJB
     components

Advantages to J2EE:
    greatly assist the integration of the J2EE environment into
     existing corporate infrastructures, most of which are quite
     CORBA intensive
    EJBs could be exposed as CORBA components that could
     be accessed by non-Java Clients
    relieves EJBs off the constraint that they could be only Java
     based

                                                            J2EE--47
EJB – CORBA INTEROPERABILITY
                                       (Scenarios)

 RMI-IIOP                        EJB Object     CORBA CLIENT                      EJB Object
 CLIENT                        Implementation                                   Implementation


      EJB Remote                                      EJB Remote
     Object Interface                                Object Interface


RMI – IIOP                       RMI-IIOP       CORBA Stub                        RMI-IIOP
  Stub                           Skeleton                                         Skeleton




  ORB                               ORB            ORB                               ORB



            Network via IIOP                                 Network via IIOP


             Scenario #1                                 Scenario #2

                                                                                                 J2EE--48
              Patterns - Definition
   Definition
     “.. are a collection of J2EE based solutions to
       common problems... They extract the core
       issues of each problem, offering solutions that
       represent an applicable distillation of theory
       and practice”.
     “ a recurring solution to a problem in a
       context”
   Repository of patterns is called the Design Pattern
    Catalog
   Documented according to a template
   Organized in tiers


                                                   J2EE--49
                 Patterns - Tiers
   Presentation Tier
      Contains the patterns related to Servlets and
        JSP technology.
   Business Tier
      Contains the patterns related to the enterprise
        beans technology
   Integration Tier
      Contains the patterns related to JMS and JDBC




                                                  J2EE--50
J2EE Pattern Relationships




                             J2EE--51
                    Presentation Tier

Pattern Name         Brief Synopsis


Decorating Filter    Facilitates pre and post-processing of a request



Front Controller     Provides a centralized controller for managing the
                            handling of a request


View Helper          Encapsulates logic that is not related to presentation
                           formatting into Helper components

Composite View       Creates an aggregate View from atomic sub-components


Service to Worker    Combines a Dispatcher component in coordination with
                          the FrontController and View Helper Patterns.


Dispatcher View      Combines a Dispatcher component in coordination with
                          the FrontController and View Helper Patterns,
                          deferring many activities to View processing.




                                                                              J2EE--52
                           Business Tier


Business Delegate    Decouples presentation and service tiers, and provides a façade
                           and proxy interface to the services.


Value Object         Exchanges data between tiers.

Session Facade       Hides business object complexity, centralizes workflow handling.


Aggregate Entity     Represents a best practice for designing coarse-grained entity
                           beans.

Value Object         Builds composite value object from multiple data sources.
      Assembler

Value List Handler   Manages query execution, results caching and result processing.


Service Locater      Hides complexity of business service lookup and creation, locates
                            business service factories.




                                                                                         J2EE--53
                     Integration Tier


Data Access Object   Abstracts data sources, provides transparent access to data.

Service Activator    Facilitates asynchronous processing for EJB components.




                                                                                J2EE--54
        Use of Patterns in DMV App
   The following patterns were used in the DMV
    Application:
      Front Controller
      View Helper
      Session Façade
      Transfer Object
      Transfer Object Assembler
      Data Access Object




                                                  J2EE--55
              Application Prototype
                  (Overview)
   JBuilder7 Enterprise
   JDataStore
   BES 5
   MS VC++ 5.0 (for non-Java Client)
   MVC architecture
                     CONTROLLER
                 (SERVLET & HANDLER)




         VIEW                           MODEL
    (JSPs & HELPER)            (EJBs & Domain classes)




                                                    J2EE--56
Application Prototype
 Use Case Diagram




                        J2EE--57
Application Prototype
Deployment Diagram




                        J2EE--58
   Application Prototype
EJBs in the DMV Application




                              J2EE--59
Application Prototype
   Class Diagram




                        J2EE--60
       Application Prototype
  Application Flow and Patterns(1)




This flow is followed by the Login, Registration
               and License Modules


                                                   J2EE--61
     Application Prototype
Application Flow and Patterns(2)




This flow is followed by the Report Module


                                             J2EE--62
         Application Prototype
    EJB exposed to non-Java Clients

 Non-Java Client     TrafficViolation Application
(C++ Application)

         Looks up the SB as a CORBA component

TrafficViolationSB        DMV Application
  (Session Bean)

         Finds the License and increments its points

    LicenseEB
  (Entity Bean)

          Updates the database


   DMV Database


                                                    J2EE--63
     Application Prototype
EJB exposed to non-Java Clients




                                  J2EE--64
Application Prototype
  Screen shots(1)




                        J2EE--65
Application Prototype
  Screen shots(2)




                        J2EE--66