TDC Services - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

TDC Services

Description:

Finder Methods returning a large result set. Long-Lived Transactions. ... Reduces coupling between presentation-tier and business services. ... – PowerPoint PPT presentation

Number of Views:26
Avg rating:3.0/5.0
Slides: 22
Provided by: henrikrm
Category:

less

Transcript and Presenter's Notes

Title: TDC Services


1
TDC Services
  • Good and bad practices using Enterprise Java Beans

2
Agenda
  • Background.
  • Bad Practies.
  • Good Practies.
  • Solution.
  • Eduction.
  • Wrap up.

3
Background
  • TDC IT-Services
  • Our first java-project in production in 1998.
  • Using BEA Weblogic for 3 years (Tengah).
  • EJB-project in production for 2 years.
  • Now 10 application in production.
  • In the next year we will deploy many new
    EJB-applications.
  • WebLogic is our strategic EJB-platform.
  • Starting a J2EE-competance center.
  • Poul Jespersen
  • Datalog fra Ã…rhus (1979).
  • 19 Ã¥r hos RC79, Tandem og Digital.
  • 3 Ã¥r hos TDC.
  • E-mail poje_at_tdc.dk

4
J2EE Architecture
Applet Container
EJB Container
Web Container
JSP, Servlet
EJB
Applet
JMS, JAA, JTA, JAF, jMail, JAXP, JDBC, JCX
JMS, JAA, JTA, jMail, JAF, JAXP, JDBC, JCX
Client
Database
JMS, JAA, JAXP, JDBC
5
Bad Practices
  • Mapping Object Model directly to Entity Beans.
  • Mapping Relational Model directly to Entity
    Beans.
  • Use Stateful session beans without care.
  • Getter/Setter Methods on bean attributes.
  • Service Lookup and other services.
  • Many calls to ejbLoad and ejbStore.

6
Bad Practices
  • Finder Methods returning a large result set.
  • Long-Lived Transactions.
  • Mapping Use case to a Session Bean ?

7
Good Practies
  • Using session beans as a facade to the entity
    beans.
  • Using Business Delegate.
  • Using session beans to represent business
    service.
  • Using composite entity beans with dependent
    objects.
  • Moving inter-entity-bean relationships into
    session beans.

8
Good Practices
  • Use Value-objects.
  • Use Value-List.

9
Solutions
  • Patterns
  • Business Delegate.
  • Value Object.
  • Composite Entity.
  • ValueObject Assembler
  • Value List.
  • Service Locator.
  • Frameworks
  • Runtime frameworks.
  • Developer frameworks.

10
Business Delegate
  • Is a client-side business abstraction.
  • Hides details of the business services and
    EJB-architecture.
  • Reduces coupling between presentation-tier and
    business services.
  • Handling of business service exceptions.
  • Better performance.
  • Hiding remoteness.
  • Introduces a new layer.

11
Value Object
  • Use Value Object to encapsulate the business data.

12
Value Object
  • Simplfies Entity Bean and Remote Interface.
  • Fewer remote and local calls.
  • Increase the complexity of synchronization.
  • Concurrent Access and Transactions.
  • Updatable value object.
  • Multiple value object
  • Validation.

13
Composite Entity
  • Problem
  • Direct mapping of the object model to the EJB
    model introduce remote reference inside an entity
    bean.
  • Manageability of many fine-grained entity beans.
  • Performance.
  • Database Dependency (each bean represents a row).

14
Composite Entity
  • Lazy loading strategy.
  • Dirty marker.
  • Why using composize entity
  • Reducing relationships between entities.
  • Reducing number of entity beans.
  • Improves performance.
  • Hidding databases for client.

15
ValueObject Assembler
  • Problem
  • Client need to access data from multiple objects.
  • Solution
  • Build value objects based from many objects.
  • Forces
  • No tight coupling between client and model.
  • Reducing traffic over the network.
  • Improving client performance.
  • Simplifies the client.

16
Value Lists
  • Problem
  • Using finder methods result in bad performance.
  • Solutions
  • Use a Value List handler to excute the search,
    may be cache the result and provide the result to
    different clients.
  • Forces
  • Better network performance.
  • Better Querying flexibility.
  • Caching possibility.
  • Client not need to call ejbFind().

17
Service Locator
  • Problem
  • Many clients lookup EJB and JMS components in
    JNDI.
  • The result is duplications of code, require the
    same home, bad performance.
  • Solution
  • A Service Locator (singleton) do all the JNDI
    calls and hides the complexities, do caching,
    reduce duplications and improve performance.
  • Fault tolerance.

18
Service Locator
19
Framework
  • Components of a framework
  • LogService (use log4j).
  • ConfigService.
  • JNDI-service.
  • JDBC-service, including connection-handling,
    caching prepare statement, etc..
  • XML-broker.
  • Generates entity-beans with value object, dirty
    marker etc., JSP-beans, value list,

20
Education
  • Its big, start small.
  • Programmers must understand the J2EE-components
  • Security.
  • Transaction.
  • Lifecycle of beans.
  • Deployment descriptors.
  • Data Accesses (load,store,isolation level,..).
  • JNDI.
  • Certified the programmer and design people.
  • Not easy to move people from Cobol/CICS to
    Java/J2EE.
  • Do reviews and use mentors.

21
Wrap Up
  • Use time on techinal design.
  • Find or develop a framework.
  • Find a development tool including UML and
    deployment tools.
  • The J2EE-world is growing faster than you can
    learn.
  • Core J2EE Patterns
  • Best Pratices and Design Strategies.
  • ISBN 0-13-064884-1
Write a Comment
User Comments (0)
About PowerShow.com