Component Technology - PowerPoint PPT Presentation

About This Presentation
Title:

Component Technology

Description:

But they have different life cycle, different persistence management, etc. ... Shared by multiple client. Accessible to other programs. State changed ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 20
Provided by: kumarm8
Learn more at: https://cse.buffalo.edu
Category:

less

Transcript and Presenter's Notes

Title: Component Technology


1
Component Technology
  • Bina Ramamurthy

2
Introduction
  • Issues Basic object-technology could not fulfill
    the promises such as reusability and
    interoperability fully in the context internet
    and enterprise level applications. Deployment was
    still a major problem and as a result portability
    and mobility are impaired.

3
Component Technology
  • We need an application architecture that works
    well in the new E-commerce age.
  • Programmer productivity, cost-effective
    deployment, rapid time to market, seamless
    integration, application portability,
    scalability, security are some of the challenges
    that component technology tries to address head
    on.
  • Enterprise Java Beans is Suns server component
    model that provides portability across
    application servers, and supports complex systems
    features such as transactions, security, etc. on
    behalf of the application components.
  • EJB is a specification provided by Sun and many
    third party vendors have products compliant with
    this specification BEA systems (webLogic), IONA
    (orbix), IBM (Webspehere), Oracle

4
Two-tier applications
5
Three-tier Applications
6
J2EE Application Programming Model for Web-based
applications
Business Logic
Web Service
Web client
7
J2EE Application Programming Model for Three-tier
Applications
8
J2EE Application Programming Model for Web-based
Applets
Business Logic
Web Service
Browser
Applet
internet
9
Roles in EJB Development
  • Bean developer Develops bean component.
  • Application assembler composes EJBs to form
    applications
  • Deployer deploys EJB applications within an
    operation environment.
  • System administrator Configures and administers
    the EJB computing and networking infrastructure.
  • EJB Container Provider and EJB server provider
    Vendors specializing in low level services such
    as transactions and application mgt.

10
Enterprise Java Bean (EJB)
  • Deployable unit of code.
  • At run-time, an enterprise bean resides in an EJB
    container.
  • An EJB container provides the deployment
    environment and runtime environment for
    enterprise beans including services such as
    security, transaction, deployment, concurrency
    etc.
  • Process of installing an EJB in a container is
    called EJB deployment.

11
Enterprise Application with many EJBs
EJB4
EJB2
WebClient
EJB1
EJB5
EJB3
EJB6
ApplClient
Lets consider a shopping front application and
figure out the possible components (EJBs)
12
Deployment with Multiple EJB Clients
EJB Container2 Deploys EJB4
Web Container1 Deploys WebApp1
EJB Container1 Deploys EJB1,EJB2,EJB3
Client Container1 Deploys Client1
Client Container3 Deploys EJB5,EJB6
13
Business Entities, Processes and Rules
  • EJB Applications organize business rules into
    components.
  • Components typically represent a business entity
    or business process.
  • Entity is an object representing some
    information maintained in the enterprise. Has a
    state which may be persistent.
  • Example Customer, Order, Employee,
  • Relationships are defined among the entities
    dependencies.

14
Process
  • Is an object that typically encapsulates an
    interaction of a user with business entities.
  • A process typically updated and changes the state
    of the entities.
  • A business process may have its own state which
    may exist only for the duration of the process
    at the completion of the process the state ceases
    to exist.
  • Process state may be transient or persistent.
  • States ate transient for conversational processes
    and persistent for collaborative processes.

15
Rules
  • Rules that apply to the state of an entity should
    be implemented in the component that represents
    the entity.
  • Rules that apply to the processes should be
    implemented in the component that represents the
    processes.

16
EJB Types
  • There are two types of EJBs
  • Entity, Session and Message
  • The syntax of the session bean and entity bean
    client-view API is almost identical.
  • But they have different life cycle, different
    persistence management, etc.
  • Session bean can be stateless and stateful beans.
  • Entity bean has evolved into a Plain Old Java
    Object (pojo) in EJB3.0 (Java 5EE)
  • Annotations are used to specify properties as
    opposed to XML descriptors in outside files.

17
Life Cycle Differences
  • Session Bean
  • Object state
  • Maintained by container
  • Object Sharing
  • No sharing per client
  • State Externalization
  • State is inaccessible to other programs
  • Transactions
  • Not recoverable
  • Failure Recovery
  • Not guaranteed to survive failures
  • Entity Bean
  • Maintained by DB
  • Shared by multiple client
  • Accessible to other programs
  • State changed transactionally and is recoverable.
  • Survives failures and restored when the container
    restarts.

18
Choosing Entity or Session Bean
  • Entity (business entity) is typically implemented
    as entity bean or a dependent object of an entity
    bean.
  • Conversational (business) process as a session
    bean.
  • Collaborative bean as an entity bean.
  • Any process that requires persistence is
    implemented as an entity bean.
  • When exposure to other applications are not
    needed for an entity or process (local/private
    process) then they are implemented as bean
    dependent objects.
  • Message driven bean is used in conjunction with
    messaging services to realize loose coupling and
    asynchronous operation.

19
Sample NewsLister Application
Application
EJB Module
Web Module
ListNews Servlet
PostNews Servlet
Message-drivenBean
SessionBean
MsgQueue
EntityBean
Persistence API
Write a Comment
User Comments (0)
About PowerShow.com