Webservice Based business components

40
S319117 - WEBSERVICE BASED BUSINESS COMPONENTS Aino Andriessen Monday, September 20, 10:00 | Hotel Nikko, Monterey I / II

Transcript of Webservice Based business components

Page 1: Webservice Based business components

S319117 - WEBSERVICE BASED

BUSINESS COMPONENTS

Aino Andriessen

Monday, September 20, 10:00 | Hotel Nikko, Monterey I / II

Page 2: Webservice Based business components

AMIS

• Systems integrator

• Co-sourcing

• Maintenance

• Oracle, Java, Open Source, ADF, DBA, SOA

• AMIS technology school

• APS

• http://www.amis.nl

• http://technology.amis.nl/blog/

Page 3: Webservice Based business components

AINO ANDRIESSEN

Technical Consultant

Technical Architect

Java, ADF, PL/SQL, XML, ...

SOA , Integration

Software engineering

Quality management

Agile development

[email protected]

http://www.fttech.net

Page 4: Webservice Based business components

S319117 - WEBSERVICE BASED

BUSINESS COMPONENTS

Aino Andriessen

Monday, September 20, 10:00 | Hotel Nikko, Monterey I / II

Page 5: Webservice Based business components

Forms

New App

ADF

Main App

ws ws

Page 6: Webservice Based business components

ADF ARCHITECTURE

Page 7: Webservice Based business components

ADF BUSINESS COMPONENTS 2

Application Modules

ViewObjects

Entities

Stored Procedures

Tables and views

ADF BC's

Database

Page 8: Webservice Based business components

ADF BUSINESS COMPONENTS 1

• ORM

• Entities

– An entity object represents a row in a database table and

simplifies modifying its data by handling all data manipulation

language (DML) operations for you.

– CRUD

• ViewObjects

– A view object represents a SQL query and simplifies working

with its result.

– CRUD

• Application Modules

– An application module is the transactional component that UI

clients use to work with application data. It defines an

updatable data model and top-level procedures and functions

(called service methods) related to a logical unit of work

related to an end-user task.

Page 9: Webservice Based business components

ADF BC 'DOMAINMODEL'

Jobs

Page 10: Webservice Based business components

CHALLENGE - 10G

• The standard option is to base ADF BC's on database

objects (tables, views).

• Programmatic BC's allow other sources.

– webservices, ref cursor, properties, etc.

– but you must do all the work yourself

– guidelines are available

Page 11: Webservice Based business components

CHALLENGE - 11G

• Programmatic BC's

• ADF BC's can be, natively, based on webservices

– but only if they have a so-called service interface

• avaliable with ADF BC based webservices

– SDO

– very new feature

Page 12: Webservice Based business components

DEMO

• Let's demo the hard-way with programmatic BC's

• Then the easy, future, way with SDO's

Page 13: Webservice Based business components

DEMO EXPLANATION

• A Webservice that provides access to jobs information.

• An ADF application to manage employees, that needs the

jobs information to translate the jobId (AD_PRES) to a

description (President).

WS Consumer

WS Producer

EmpJob

Job

UI

Page 14: Webservice Based business components
Page 15: Webservice Based business components

WEBSERVICE PRODUCER

• Standard ADF BC's

• Remote interface

• AM client interface method

– objects must be serializable

• Pojo's

• Deploy

Page 16: Webservice Based business components
Page 17: Webservice Based business components

WEBSERVICE CONSUMER

• webservice proxy

– standard client to access webservice

– can easily be generated

Page 18: Webservice Based business components

DEMO CONTINUED

Page 19: Webservice Based business components
Page 20: Webservice Based business components

CHALLENGE

Page 21: Webservice Based business components

ADF app / WS Consumer

ACCESS WEBSERVICE

WS Producer

JobGenerated Proxy

DataAccess

JobEO JobsVw

ProgrammaticResultSet

Pojo

Page 22: Webservice Based business components

• BaseClasses

– Overriden methods

– General methods

• Utility classes

– Hold retrieved data

– Conversion

– Service access via proxy

Page 23: Webservice Based business components

BASECLASSES

JobEOinsertRow()updateRow()deleteRow()getCurrentRow()

JobsVwgetProgrammaticResultSet()

EntityBasedoDML()doSelect()

VOBasecreate()executeQueryForCollection()hasNextForCollection()createRowFromResultSet()getQueryHitCount()releaseUserDataForCollection()

DAJobs

DataAccess

Page 24: Webservice Based business components

OVERRIDE METHODS

• Entity

– doSelect()

– doDML()

• ViewObject

– create()

– executeQueryForCollection()

– hasNextForCollection()

– createRowFromResultSet()

– getQueryHitCount()

– releaseUserDataForCollection()

• viewlinkaccessors

Page 25: Webservice Based business components

CONVERTERS

• Generic code

– to support multiple objects

• Represent data in tabular form (rows, colums)

– ProgrammaticResultSet

Page 26: Webservice Based business components
Page 27: Webservice Based business components
Page 28: Webservice Based business components

SHORT WRAP UP

• Producer

• Consumer

– ws proxy

– programmatic BC's

– override a few standard methods

– lot of custom code, especially for conversion

Page 29: Webservice Based business components
Page 30: Webservice Based business components
Page 31: Webservice Based business components

SERVICE INTERFACE PRODUCER

• Special webservice

– Business Components service interface

• Create on top of BC's

– Create BC's

– Enable service interface

• VO's are published as SDO's

– compare to custom POJO in 10g impl.

– extends from org.eclipse.persistence.sdo.SDODataObject

• Service is also available as EJB

• Support for relations

Page 32: Webservice Based business components

SERVICE INTERFACE CONSUMER

• Create Entity

– Service Interface entity

• Base VO on entity

• Include common jar from

producer (with object

definitions)

• Configure connection

<DataSource

DataSourceClass="oracle.jbo.datasource.svc.SIEODataSourceImpl"

Type="ServiceInterface">

<ServiceInterface

ServiceName="{/nl/amis/demo/wsbc/jobprod/model/ams/common/}JobSDOService"

SDOName="{/nl/amis/demo/wsbc/jobprod/model/queries/common/}JobsVwSDO"

SVIName="Jobs"

CreateOpName="createJobs"

UpdateOpName="updateJobs"

GetOpName="getJobs"

FindOpName="findJobs"/>

</DataSource>

Page 33: Webservice Based business components

SERVICE DATA OBJECT

• Service Data Objects is a technology that allows

heterogeneous data to be accessed in a uniform way.

– The SDO specification was originally developed in 2004 as a

joint collaboration between BEA and IBM and approved by

the Java Community Process.

– Version 2.0 of the specification was introduced in November

2005 as key part of the Service Component Architecture.

• Java standaard

• Disconnected

Page 34: Webservice Based business components

ISSUES

• Connection either via SOAP or EJB

• Configuration

• In webapp:

– Only EJB works

– SOAP will work in the next JDev version

• Very new feature

Page 35: Webservice Based business components

SERVICE BASED WEBSERVICE

INTERACTION

• WS datacontrol

• WebService proxy

– WSDL

• Custom interaction

– REST

• Jersey Client

• Commons HTTPClient

Page 36: Webservice Based business components
Page 37: Webservice Based business components

• Business Components can be based on webservices but it's

not a trivial exercise and requires a lot of work

• Others have done it before so don't invent the wheel again.

• It's much easier to use 11g service interface BC's, but they

requires service interface webservices and are still under

development, although almost done.

Page 38: Webservice Based business components
Page 39: Webservice Based business components

S313467 - ADF BUILD PROCESS WITH

MAVEN AND HUDSON

Aino Andriessen

Thursday, September 23, 11:00 | Hotel Nikko, Peninsula

Page 40: Webservice Based business components