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

Post on 21-Aug-2018

222 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

1

Developing BOF-Oriented Services for J2EE Applications

Documentum Developer Conference 2004October 04, 2004

2

Agenda

�What is BOF

�What is J2EE

�Adopting BOF to J2EE

�Best Practice

�Q & A

3

Business Object Framework (BOF)

�BOF Overview

�What are Type-Based Objects (TBOs)?

�What are Service-Based Objects (SBOs)?

�BOF DFC APIs

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.

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

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

7

Business Object Framework

� TBO architecture

8

Business Object Framework

9

Business Object Framework

� Implement a TBO – Public interface IMySOP extends IDfBusinessObject

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

IDfDynamicInheritance{…}

10

Business Object Framework

� SBO Architecture

11

Business Object Framework

� SBO

12

Business Object Framework

� Implement a SBO – public interface IFrontControllerSBO extends IDfService

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

}- public class FrontControllerSBO implements IFrontControllerSBO

{…}

13

BOF DFC API

� Java Package: com.documentum.fc.client

� IDfBusinessObject

� IDfDbor/IDfDborEntry

� IDfService/DfService

14

J2EE

�Leading Enterprise Application Platform

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

15

J2EE Architecture� Presentation + Business Logic + Data

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

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

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>

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

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

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 ()

22

Adopting BOF to J2EE

� .NET WebServices– Code:

TrywsClient.methodXXXl(“param1)

Catch Ex As Exception//error handling

End Try

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);

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)

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

26

BOF-Based J2EE Architecture

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

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

29

Q & A

top related