developing bof-oriented services for j2ee applica tions · developing bof-oriented services for...

29
1 Developing BOF-Oriented Services for J2EE Applications Documentum Developer Conference 2004 October 04, 2004

Upload: lamhanh

Post on 21-Aug-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

1

Developing BOF-Oriented Services for J2EE Applications

Documentum Developer Conference 2004October 04, 2004

Page 2: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

2

Agenda

�What is BOF

�What is J2EE

�Adopting BOF to J2EE

�Best Practice

�Q & A

Page 3: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

3

Business Object Framework (BOF)

�BOF Overview

�What are Type-Based Objects (TBOs)?

�What are Service-Based Objects (SBOs)?

�BOF DFC APIs

Page 4: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

4

BOF Overview

�What are Documentum Business Object– Encapsulates business logic– Separates concerns from data layer and presentation layer– Provides solutions to specific business problems– Examples:

DFC 5.2 ships with workflow inbox service, workflow reporting, subscriptions etc.

Page 5: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

5

BOF Overview

�How are Documentum Business Objects Written?– Currently, DBO must be written in Java– Using a DBO requires much less knowledge of DFC and data tier

Page 6: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

6

BOF Overview

�What is BOF?– Allows you to build, test, discover, deploy and run business logic as DBO– Session and Transaction Management– The framework is built into DFC (5.x)– Unlike API, it allows you to extend DFC and add your own behavior

Page 7: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

7

Business Object Framework

� TBO architecture

Page 8: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

8

Business Object Framework

Page 9: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

9

Business Object Framework

� Implement a TBO – Public interface IMySOP extends IDfBusinessObject

{..}– Public class MySOP extends DfDocument implements IMySOP,

IDfDynamicInheritance{…}

Page 10: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

10

Business Object Framework

� SBO Architecture

Page 11: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

11

Business Object Framework

� SBO

Page 12: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

12

Business Object Framework

� Implement a SBO – public interface IFrontControllerSBO extends IDfService

{public void process(Request requster, Response response);

}- public class FrontControllerSBO implements IFrontControllerSBO

{…}

Page 13: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

13

BOF DFC API

� Java Package: com.documentum.fc.client

� IDfBusinessObject

� IDfDbor/IDfDborEntry

� IDfService/DfService

Page 14: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

14

J2EE

�Leading Enterprise Application Platform

�Key Concepts– JSP/Servlet– EJB– JNDI– WebServices– More…

Page 15: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

15

J2EE Architecture� Presentation + Business Logic + Data

Page 16: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

16

Adopting BOF to J2EE

�Why BOF to J2EE– WDK Vs. Struts Vs. BOF– Many existing systems were developed in J2EE/Struts.– Leverage DFC/BOF to integrate to existing J2EE apps.– Service-Oriented Benefits

Page 17: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

17

Adopting BOF to J2EE

� How to make a J2EE component BOF-aware– No multiple inheritance– Servlet

Extends from javax.servlet.http.HttpServlet, Add reference to SBO Controller in the base Action/Servlet.

– EJBBean class implements javax.ejb.Session, can implement IDfService and extends DfServiceDfService is NOT SerializableUse BOF adapter to control “Transient” variables

Page 18: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

18

Adopting BOF to J2EE

�How to expose SBOs as WebServices– How to expose SBOs as WebServices– Use Apache Axis Servlet/SBO-aware Servlet– Axis Model– Map normal SBO/Java Class in Axis Sever-config.wsdd<service name=“SBOJavaWebServices" provider="java:RPC">

<parameter name="className" value=“com.abc.webservices.WebServicesSBO"/><parameter name="allowedMethods" value="*"/>

</service>

Page 19: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

19

Adopting BOF to J2EE

�How to expose SBO as EJBs– Use EJB Controller and EJB Adapter– Use SBO-aware EJBs– Or, Single EJB façade delegates SBO calls

Page 20: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

20

Adopting BOF to J2EE

�Struts– How to call those services and EJBs from Struts– Base Struts action– Request/Response Model– Request Object– Response Object– Stateless

Page 21: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

21

Adopting BOF to J2EE

� .NET WebServices– How to invoke SBOs from .NET via WebServices

Wsdl Http://localhost/app1/SBOWebServices?WSDLcsc /out:SBOWebServices.dll /t:library/r:System.XML.dll,System.Web.Services.dll,System.dll SBOWebServices.csDim wsClient As new SBOWebServices ()

Page 22: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

22

Adopting BOF to J2EE

� .NET WebServices– Code:

TrywsClient.methodXXXl(“param1)

Catch Ex As Exception//error handling

End Try

Page 23: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

23

Adopting BOF to J2EE

� Wrapping JMX calls– What is JMX?– In BOF SBO, add code to create Server and register MBeans:

MBeanServer server = MBeanServerFactory.createMBeanServer();HtmlAdaptorServer html = new HtmlAdaptorServer();String port = "8082";ObjectName html_name = null;html_name = new ObjectName("Adaptor:name=html,port=" + port);server.registerMBean(html, html_name);

Page 24: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

24

Adopting BOF to J2EE

�Configuration Issue– DBOR revisited– Use it to store other key/value pairs

nterface1=other, value1, 1.0– J2EE Configuration

WEB-INF/web.xmlWEB-INF/struts-config.xmlWEB-INF/applicationContext.xml (Spring)

Page 25: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

25

Adopting BOF to J2EE

�Wrap your BOF work into a simple J2EE SOA layer– Add a Front Controller SBO to route service Requests to other low-level Controller

SBOs– Add specific low-level Controller SBOs to handle specific APIs or client requests– Add XML service mapping to facilitate routing– Use Reflection – Build bridge to Struts at Front Controller layer

Page 26: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

26

BOF-Based J2EE Architecture

Page 27: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

27

Best Practice

�Use Adapter Design Pattern to simplify the base implementation class of SBOs

� Implement Base Struts Action to simplify SBO references

�Use SOA concept to handle request/response

�Use Front Controller pattern to centralize message passing and routing

Page 28: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

28

References

� .NET Framework SDK 1.1

� JDK 1.4

� J2EE 1.4

�Struts 1.1

�DFC User’s Guide

�DFC Advanced Training Manual

� JavaWorld article published on Oct 04, 2004

Page 29: Developing BOF-oriented Services for J2EE Applica tions · Developing BOF-Oriented Services for J2EE Applications ... Map normal SBO/Java Class in Axis Sever-config.wsdd ... J2EE

29

Q & A