Automating Application Development for Legacy IT Systems with SOA & MDA
Framework & Code GeneratorBy Dr. Chung-Yeung Pang, Seveco AG, [email protected]
Situation in IT Programming Languages:
~3 million COBOL programmers. ~1.6 million VB programmers. ~1.1 million C/C++ programmers.
Most mission critical applications have been written in COBOL. The dependency on the interfaces, performance, transaction scopes
prohibits the change and mixing of other programming languages.
IBM reported the usage of zSeries mainframes grew 28% year-to-year in 2005.
The COBOL Center publishes: Investment in COBOL expected to be over $1.5 Trillion. Number of transaction in COBOL > hits on the Internet.
Experience (1)
1998 Experience with CORBA IDL drove us to move from fixed record remote
procedure call style messaging to document-style messaging with XML and took a step into Service Oriented Architecture (SOA).
2000 Facing problems with interoperability between old and new platforms led
to the development of SOA in legacy IT environment and COBOL XML framework.
2003 First code generator for Data Object Descriptors for marshalling and
unmarshalling of XML structure from / into COBOL data structure based on class diagrams.
Experience (2)
2004 Introduced Model Driven Architecture (MDA) techniques into business
service development. Developed a context based centralized service process controller
service architecture that allows plug and play of business components.
2005 Leveraged SOA and MDA in multiple projects.
2006 Developed service and unit test automation using MDA approach. Developed high level platform independent modelling and generation of
platform dependent code such as PL1 and Java. Developed frameworks for integrating existing applications written in
different languages into SOA.
Experience (3)
Success in 8 IT projects Treasury Products, Credit, Payments, and Securities. Project size: 10-30 team members.
Achievement Turned failure projects to success.
From Undocumented systems Ad-hoc software development style Low productivity Error prone Inflexible for code adaptation to standards Low/no reusability Require experienced programmers for the development
To Documented systems with modelling Architect & Analyst driven development High productivity Minimum error Flexible code adaptation to standards High reusability Automation through the use of models and effectively reduce the number of
experienced programmers for the development
Traditional Modular Architecture
Strong coupling of modules with no central control of business logic.
Difficult to test individual modules.
Does not allow plug and play of modules.
Difficult to enhance and maintain.
Silo or monolithic approach to solving business requirements.
A
B C
D E F G H
Service Interface
Component Based Service Oriented Architecture
Mainframe
Service Mediator
Adap
tor
Context Container (IDOM)
Existing Program
Ada
ptor
Existing Program
Service Component
Service Component
XML
Service Process Controller
Framework XML Handling Facilities in COBOL, PL1, C++, Java
XML parser for transformation of XML messages into integrated document object model IDOM.
Marshalling and Unmarshalling Data Object structure to and from XML tree structure using meta-information from Service Data Object Descriptors (SDOD).
XPath support. Service Mediator
Control transaction. Handle service messages. Set up the context container. Resolve and instantiate service process controller.
Context Container (IDOM) Contains service context in a document style tree structure in an Integration
Document Object Model. Provides API to insert and extract data from the service context as well as
navigation of the context tree. Service Process Controller
A finite state machine that performs the centralized process control based on Service Process Control Descriptor (SPCD) with state, event and transition.
Message Interface Modelling and Generation Message Interface Modelling (MIM) and SDOD generation based
on class diagrams
Data Structure of Existing
Program (e.g. COBOL Copy
Book)
SDOD in COBOL/ PL1/ Java/ C
XML/DTD/XSD
Data Object (COBOL Copy Book/ PL1 Structure/ Java Class/ C
Header File)
Customer
id : txt32name : txt32firstName : txt32
Address
street : txt32streetNo : n4city : txt32cityCode : n9country : txt32
11
Optional
Service Message and Context Design
Customer
id : txt32name : txt32firstName : txt32
Address
street : txt32streetNo : n4city : txt32cityCode : n9country : txt32
Account
no : txt32type : txt32balance : amountinfoText : txt256
Custody AccountBank Account
interestRate : n3
Current Account
FX Account
Movement
transId : txt32mDate : datetype : txt32mAmount : amountinfoText : txt256
Trade Movement
buySellCode : txt1stockId : txt32stockName : txt32price : amounttotalStock : n9
Deposit Withdraw Movement
depositWithdrawCode : txt1
FX Trade Movement
buySellCode : txt1currency : currencyCodetransactionRate : amountcurrencyAmount : amount
Saving Account
11
*
1
*
1
*
1
*
1
XML/DTD/XSD
Service Process Control Descriptor Design and Generation
SPCD design and generation from state model.
Customer Info Processing
«Process State»
ServiceGet Customer Info
Account Info Processing
«Process State»
ServiceGet Customer Account Info
Normal Account Position Keeping Processing
«Process State»
ServiceGet Account Movements
FX Account Position Keeping Processing
«Process State»
ServiceGet FX Account Movements
[Control Stack Empty]
Custody Account Position Keeping Processing
«Process State»
ServiceGet Custody Account Movements
Customer Asset View Request
Customer Info Retrieved
Custody Account Info Retrieved Account Info Retrieved FX Account Info Retrieved
Custody Account Movements Retrieved Account Movements
Retrieved
FX Account Movements Retrieved
Service Component Modelling and Generation Frame and pattern based modelling and
up to 100% code generation.Customer Adaptor
«Procedure» initializeAdaptor ()«Procedure» createDataObject ()«Procedure» getCustomerID ()«Procedure» callCustomerInfo ()«Procedure» setEvent ()«Procedure» setLogicalRef ()
«SOAF Start Class»CustomerInfo
W-Parm
CustomerID : txt32
1 1«reference»
1 1 01 IDOM-Data. COPY FWPC0000.
01 W-Parm. 05 CustomerID PIC X(32).
LINKAGE SECTION. *+---+---+---+---+---+---+----------+----------------------------* 01 CustomerInfo. COPY CUSTINFO.
01 PC-Data. COPY FWPC0000.
*----------------------------------------------------------------* PROCEDURE DIVISION USING PC-Data . *+---+---+---+---+---+---+----------+----------------------------* MAIN SECTION.
PERFORM initializeAdaptor IF Status-Error THEN PERFORM Handle-Error GO TO Return-Point END-IF PERFORM createDataObject IF Status-Error THEN PERFORM Handle-Error GO TO Return-Point END-IF PERFORM getCustomerID IF Status-Error THEN PERFORM Handle-Error GO TO Return-Point END-IF PERFORM callCustomerInfo IF Status-Error THEN PERFORM Handle-Error GO TO Return-Point END-IF
Error Sequence Frame
Module
initializeAdaptor«Procedure»
createDataObject«Procedure»
getCustomerID«Procedure»
callCustomerInfo«Procedure»
setEvent«Procedure»
setLogicalRef«Procedure»
initializeAdaptor«Procedure»
createDataObject«Procedure»
getCustomerID«Procedure»
callCustomerInfo«Procedure»
setEvent«Procedure»
setLogicalRef«Procedure»
Pattern
InitActionChain«Code Pattern»
CreateDataObject«Code Pattern»
GetAttributeFromIDOM«Code Pattern»
CallObject«Code Pattern»
SetEvent«Code Pattern»
SetLogicalRef«Code Pattern»
InitActionChain«Code Pattern»
CreateDataObject«Code Pattern»
GetAttributeFromIDOM«Code Pattern»
CallObject«Code Pattern»
SetEvent«Code Pattern»
SetLogicalRef«Code Pattern»
DOD="Customer Info"DataObject=CustomerInfo
XPath="./Customer[@ID]"Attribute=CustomerID
Object=CUSTINFOParameters="CustomerID, CustomerInfo"
Event="Customer Info Retrieved"
LogicalName="Customer ID"Reference=CustomerID
Test Automation (1) Test data has XML format and structure is generated from class
model. Direct testing for business services with XML messages. Test service components or any existing applications with test
modules generation.
Interface Class Test Data Structure Test Data
Test Case Model
Test Module
mapXMLToDataStructure ()callApplModule ()renderOutputXMLFromDataStructure ()
Test XML
11 generates 1 1..*fill in for
*
1
generates
*
1
generates
*
1
«use»
«use»
Test Automation (2)
Test Case Model Test Service Mediator
Test Module
mapXMLToDataStructure ()callApplModule ()renderOutputXMLFromDataStructure ()
Application Module
Test XML Message
*
1
activates
1
1
calls
Case Tool Host System
Use of SOA for testing.
Test Automation (3) Modelling test process using
class and activity diagram. Generate test scripts in VB or
Java Script for test process. Execute test scripts direct from
modelling tool or from a batch file.
Trade Sequence Test Case
Define_Files«Code Segment»
Fetch_Abacus_Id«Code Segment»
Update_Abacus_Id«Code Segment»
Set-Abacus_Id«Code Segment»
Do_Test«Code Segment»
Get_Status«Code Segment»
Log_Status«Code Segment»
Write_Output«Code Segment»
Display_Output«Code Segment»
Exit_For«Code Segment»
For
For
Display_Complete«Code Segment»
If
Joint
Define_Files«Code Segment»
Fetch_Abacus_Id«Code Segment»
Update_Abacus_Id«Code Segment»
Set-Abacus_Id«Code Segment»
Do_Test«Code Segment»
Get_Status«Code Segment»
Log_Status«Code Segment»
Write_Output«Code Segment»
Display_Output«Code Segment»
Exit_For«Code Segment»
For
For
Display_Complete«Code Segment»
If
Joint
VBS Pattern
Define-Variables«Code Pattern»
Get-XML-Value-With-Check«Code Pattern»
Calculate-Value«Code Pattern»
Set-XML-Value-With-Check«Code Pattern»
Execute-Test-From-File«Code Pattern»
Get-XML-Value-From-Stream«Code Pattern»
Add-Log-Entry«Code Pattern»
Write-String-To-File«Code Pattern»
Display-File-In-Application«Code Pattern»
Display-Message«Code Pattern»
Define-Variables«Code Pattern»
Get-XML-Value-With-Check«Code Pattern»
Calculate-Value«Code Pattern»
Set-XML-Value-With-Check«Code Pattern»
Execute-Test-From-File«Code Pattern»
Get-XML-Value-From-Stream«Code Pattern»
Add-Log-Entry«Code Pattern»
Write-String-To-File«Code Pattern»
Display-File-In-Application«Code Pattern»
Display-Message«Code Pattern»
«Use Pattern»«Use Pattern»
Variable-Name=aFilesVariable-Value="""" & Directory & "TR.xml", """" & Directory & "TB.XML", """" & Directory & "TC.xml"
«Use Pattern»«Use Pattern»
File-Name="""" & Directory & "TB.xml"XPath="//transactionRef"Check-XPath="//ids/system/systemID"Check-Value="ABACUS"Return=abacus_id
Variable-Name=abacus_idWith-Value=+1
«Use Pattern»«Use Pattern»
File-Name=fileNameXPath="//transactionRef"Value=abacus_idCheck-XPath="//ids/system/systemID"Check-Value="ABACUS"
«Use Pattern»«Use Pattern»
User-Name=User-NameFile-Name=fileNameOutput=testResult
«Use Pattern»«Use Pattern»
Stream=testResultXPath="//Status@Result"Return=status
«Use Pattern»«Use Pattern»
Entry-Value="File Name: ", fileName, " Status: ", status}
«Use Pattern»«Use Pattern»
File-Name="exception.xml"Value=output
«Use Pattern»«Use Pattern»
File-Name="exception.xml"Application-Name="notepad"
«Use Pattern»«Use Pattern»
Message-Text="Test process successfully completed!"
[Each fileName in files]
[Each fileName in files]
[status = 'Exception']
«Action Module»Test-Case-One
User-NameDirectoryLibrary-Directory = S:\Test Automation Demo\Library\«Action Module Constructor» Test-Case-One ()
Yeung Test Case One:Test-Case-One::Test-Case-One
User-Name = yeungDirectory = C:\TestData\YeungLibrary-Directory = S:\Test Automation Demo\Library\
«Action Module»
Test Script
Benefits Best practices. Well documented system. Plug & play SOA. Simplify testing and integration. Maximize reuse. Increase business and IT agility. Leveraging what already exists and add
functionality as required. Scalable development. Resource sharing across organization
using repository based (ARTISAN) modelling tool.
Reduce development & maintenance cost.
Traceable from requirements to the code.
Demo
Model Definition Code Generation