bcd session 01

Upload: poornimarachiraju

Post on 02-Jun-2018

240 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 BCD Session 01

    1/24

    Slide 1 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    In this session, you will learn to:

    Identify characteristics of Enterprise Java Beans technology,

    for EJB 3.0 specification

    Identify the use of annotations

    Define the Java Platform, Enterprise Edition (Java EE)Examine the Java EE application architecture

    Examine the EJB application creation process

    Compare the Java EE application development with traditional

    enterprise application development

    Objectives

  • 8/10/2019 BCD Session 01

    2/24

    Slide 2 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    EJB 3.0 Specification

    Enterprise JavaBeans (EJB) is defined as a server-side

    component framework that builds enterprise-class

    distributed component applications in Java.

    You can create scalable, reliable, transactional, secure, and

    multi-user distributed applications by using EJB.EJB is designed to support application portability and

    reusability across any vendors enterprise middleware

    services.

    The new EJB3.0 API offers ample of simplification over the

    previous version EJB API.

  • 8/10/2019 BCD Session 01

    3/24

    Slide 3 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    Prior to EJB 3.0

    The following list briefly describes some of the general EJB

    2.x implementation artifact:

    Enterprise bean class

    EJB object

    Remote interfaceLocal interface

    Home interface

    Deployment descriptor

    Vendor-specific files

    The Ejb-jar file

  • 8/10/2019 BCD Session 01

    4/24

    Slide 4 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    EJB 3.0 Enterprise Bean

    EJB 3.0 beans are the Plain Old Java Object (POJO) styled

    beans as opposed to pre-EJB 3.0 enterprise beans that

    used to constitute multiple Java classes and interface per

    EJB component.

    EJB 3.0 bean has all its code contained in a single Javaclass.

    EJB 3.0 enterprise bean provides a single business

    interface for both local and remote clients.

    EJB 3.0 bean provides a bean class that provides definitions

    of only the business interface.EJB 3.0 bean does not have a home interface.

    A message-driven bean, in EJB 3.0, doesnt need a

    business interface.

  • 8/10/2019 BCD Session 01

    5/24

    Slide 5 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    EJB 3.0 Enterprise Bean (Contd.)

    The bean provider is not required, in EJB 3.0, to implement

    the component interface regardless of whether it is needed

    or not.

    The bean class does not have to implement the component

    interfaces, javax.ejb.SessionBean for a session bean orjavax.ejb.MessageDrivenBean for a message-driven bean.

  • 8/10/2019 BCD Session 01

    6/24

    Slide 6 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    Annotations

    The use of annotation is one of the most important features

    of EJB 3.0 specification.

    They have been added to the java language in Java Service

    Request 175 (JSR) and made available since the release of

    Java 5 platform.Annotation is defined as the metadata that consists of the

    additional definition that can be attached inside your source

    file.

    They can be used as an alternative to the standard XML

    deployment descriptor files.Java annotations provide information about the code in the

    code itself. They are complied and type-checked. They can

    be accessed at the runtime by using Java reflection, but

    cannot perform computation.

  • 8/10/2019 BCD Session 01

    7/24Slide 7 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    Annotations (Contd.)

    Annotations can be applied to various elements of the Java

    code such as methods, variables, constructors, package

    declarations, and so on.

    Annotations begin with an @ sign followed by the

    annotation name which in turn is followed by annotationdata.

    You can use annotations if:

    The metadata you are applying changes the design of the

    class.

    The metadata changes the design of code interacting with theclass.

  • 8/10/2019 BCD Session 01

    8/24Slide 8 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    Annotations (Contd.)

    Benefits of using annotations in Java:

    Annotations are compiled by Java language compiler,

    therefore no external tools are required.

    Annotations are potable, because the metadata is

    standardized.

    Annotations on a class can be kept in a class file and retained

    for accessing at the runtime.

    Drawbacks of annotations:

    Annotation cannot form an inheritance hierarchy like interfaces

    and classes.

    Annotation data member types are restricted to primitive types,

    String, Class, enum, annotation types, and arrays of the

    preceding types.

    You must access permission on the code, to annotate it.

  • 8/10/2019 BCD Session 01

    9/24Slide 9 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    Java EE is the standard for developing portable, robust,

    scalable, and secure server-side Java applications.

    The Java EE platform consists:

    A set of specifications.

    Java EE 5 Software Development Kit (Java EE 5 SDK).Commercial and open source Java EE application servers and

    tools.

    Java EE components and applications.

    Introducing the Java Platform Enterprise Edition (Java EE)

  • 8/10/2019 BCD Session 01

    10/24Slide 10 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    Examining the Java EE Application Architecture

    The key features of the component-container architecture

    are:

    Separation of application specific functionality and application

    generic functionality.

    Components consist of application specific functionality.

    Containers consist of the generic functionality common to all

    enterprise applications.

    Containers provide an execution environment for components.

    Containers provide services for components.

  • 8/10/2019 BCD Session 01

    11/24Slide 11 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    Examining the Java EE Application Architecture (Contd.)

    The following figure shows the component-container

    architecture.

  • 8/10/2019 BCD Session 01

    12/24Slide 12 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    Examining the Java EE Application Architecture (Contd.)

    The following figure shows the Java EE containers

    associated with the Java EE platform.

  • 8/10/2019 BCD Session 01

    13/24Slide 13 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    Examining the Java EE Application Architecture (Contd.)

    The following table lists the containers, components and the

    machines that host the containers.

    Container Compo nent Type Container Host

    EJB container EJBs EJB container is part of the Java EE

    application server.Web container Servlets and

    JavaServer

    Pages (JSP)

    EJB container is part of the Java EE

    application server.

    Applet

    container

    Applets Applet container can be a web browser or

    other application that supports the applet

    programming model. The applet container is

    hosted on a client machine.

    Application

    client

    container

    Application client

    component

    Application client container is hosted by the

    client machine.

    Web browser Web pages Web browser is hosted by the client

    machine.

  • 8/10/2019 BCD Session 01

    14/24Slide 14 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    Examining the Java EE Application Architecture (Contd.)

    The following figure shows the Java EE application

    architecture with the inclusion of the application

    function-specific components.

  • 8/10/2019 BCD Session 01

    15/24

  • 8/10/2019 BCD Session 01

    16/24Slide 16 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    Examining Java EE Container Services (Contd.)

    Vendor-specific functionality- Vendor-specific functionality can

    include clustering, which addresses:

    Scalability.

    Failover.

    Load balancing.

    API-based services- The supporting services and APIs that areincluded in the Java EE platform are:

    Java DataBase Connectivity (JDBC) API for database

    connectivity

    JNDI API

    RMI over Internet Inter-Object Request Broker (ORB) Protocol

    (IIOP) and the interface definition language (IDL) for the Java

    application

    JavaMail API and JavaBeans Activation Framework (JAF) API

    Java EE Connector Architecture

    JMS API

  • 8/10/2019 BCD Session 01

    17/24Slide 17 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    Examining Java EE Container Services (Contd.)

    JMS API

    JTA

    Java Authentication and Authorization Service (JAAS)

    Java API for XML Processing (JAXP)

    Web services integration features

    JMXTimer services

  • 8/10/2019 BCD Session 01

    18/24Slide 18 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    Examining Java EE Container Services (Contd.)

    The following figure shows the accessibility of important

    API-based services with Java EE containers.

  • 8/10/2019 BCD Session 01

    19/24Slide 19 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    Examine the EJB Application Creation Process

    Adhere to the following steps to create an EJB application:

    1. Use your preferred object oriented methodology to analyze the

    business problem.

    2. Analyze the inter-tier communications requirements.

    3. Use entity classes to model the persistence data.

    4. Use session beans and synchronous service faade.

    5. Use the JMS API and message-driven beans.

    6. Create the client.

    7. Assemble and package the application.

    8. Deploy the server-side components.9. Package and distribute the client.

  • 8/10/2019 BCD Session 01

    20/24Slide 20 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    Examine the EJB Application Creation Process (Contd.)

    The following figure shows the creation of Java EE

    components and their assembly into Java EE modules.

  • 8/10/2019 BCD Session 01

    21/24Slide 21 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    Comparing Java EE Application Development With Traditional Enterprise Application Development

    Java EE platform:

    Provides strict separation of the application components from

    the general services and infrastructure.

    Helps the developers to focus on the application business

    logic.

  • 8/10/2019 BCD Session 01

    22/24Slide 22 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    Comparing Java EE Application Development With Traditional Enterprise Application Development (Contd.)

    The following figure shows the advantages of using

    server-provided services.

  • 8/10/2019 BCD Session 01

    23/24

    Slide 23 of 24Ver. 1.0

    Business Component Development Using EJB Technologies

    In this session, you learned that:

    Enterprise JavaBeans (EJB) is defined as a server-side

    component framework that builds enterprise-class distributed

    component applications in Java.

    EJB 3.0 beans are the POJO styled beans as opposed to

    pre-EJB 3.0 enterprise beans that used to constitute multipleJava classes per EJB.

    The home interface and the component interface are

    eliminated from EJB 3.0 enterprise bean.

    Annotation, defined as the metadata, consists of the additional

    definition that can be attached to an element within the code tohelp further explain.

    Summary

  • 8/10/2019 BCD Session 01

    24/24

    Business Component Development Using EJB Technologies

    Annotations can be applied to various elements of the Java

    code such as:

    Methods

    Variables

    Constructors

    Package declarationsJava EE is the industry standard for developing portable,

    robust, scalable, and secure server-side Java applications.

    The Java EE component model relies on both container-based

    and platform services.

    Java EE services can be grouped into the following categories:Deployment-based

    Inherent services

    Vendor-specific functionality

    API-based services

    Summary (Contd.)