cobol and distributed architecture boris gilad cobol solutions manager [email protected]...
Post on 18-Dec-2015
221 views
TRANSCRIPT
COBOL and Distributed Architecture
Boris GiladCOBOL Solutions Manager
Agenda
Object Oriented COBOL
COBOL - Java interaction
COBOL and XML
COBOL and Web Services
COBOL and EJB
COBOL.Net
Q & A
COBOL and others - then and now
From COBOL To COBOL
Past Call Using Linkage Section
Call “System” Invoking from command line
Present COBOL-RPC
COBOL-CGI
CORBA
OO COBOL COBOL RTS as OO Class
Future COBOL XML COBOL XML
Consuming WS from COBOL Exposing COBOL as WS
Exposing COBOL as EJB
.Net .Net
Object Oriented COBOL concepts
Objects and Classes
Object References Predefined Object References
Methods Method Invocation
Interfaces
Polymorphism Class Inheritance
ETC, ETC, ETC
Calling Java from COBOL
Access JDBC Data Sources from COBOL
Send messages to Java Objects from COBOL using the Java Domain
Calling Procedural COBOL from Java
Access existing COBOL assets from Java using mfcobol.runtime class
Calling Object COBOL from Java
Access COBOL objects from Java Programs
Wizard generates Java wrapper class
Micro Focus COBOL/XML Syntax
Provide a higher level COBOL orientated approach to COBOL/XML
Adds significant new syntax to handle XML documents to consume, create, update and XML documents from COBOL• Based on familiar approach used with COBOL I/O support• Provides both SAX style or DOM style parsing
Map to/from XML W3C Compliant Schemas
COBOLRecord
CBL2XMLXML
Schema
Micro Focus Syntax - SELECT
SELECT statement is the foundation
Just like COBOL File I/O
SELECT xml-bookdb ASSIGN "c:bookrw.xml“
ORGANIZATION IS xml
DOCUMENT-TYPE IS "bookdb.xsd"
FILE STATUS IS xml-bookdb-status.
Micro Focus Syntax - XD
XD stucture - the association between XML and COBOL records
xd xml-bookdb.01 xml-bookdb-query identified by "query“. 03 xml-book occurs 3 identified by “book”. 05 xml-bq-author pic x(40) identified by "author".
05 xml-bq-title pic x(40) identified by "title".
represents an XML document that has structure:
<query> <book>
<author>Author Name</author> <title>Book Title</title> </book> <book>
<author>Author Name</author> <title>Book Title</title> </book></query>
Micro Focus Syntax – Basic Verbs
OPEN {input|output|i-o} file-name• surprise, surprise, surprise
READ file-name• Read entire XML document
WRITE file-record• Write entire XML document
CLOSE file-name• more surprises…
What is Service?
What Service do I provide?
What Input do I receive?
What Output do I return?
Where to find me?
COBOL Program as Service
linkage section.
01 lnk-function pic x.
88 read-record value "1".
88 add-record value "2".
88 delete-record value "3".
88 next-record value "4".
01 lnk-file-status pic xx.
01 lnk-details.
03 lnk-text-details.
05 lnk-title pic x(50).
05 lnk-type pic x(20).
05 lnk-author pic x(50).
03 lnk-stockno pic x(4).
03 lnk-retail pic 99v99.
03 lnk-onhand pic 9(5).
03 lnk-sold pic 9(5) comp-3.
COBOL Program as Service
Service Read_Record lnk-function = 1 Service Add-Record lnk-function = 2
Input lnk-stockno Input lnk-stockno
Output lnk-file-status lnk-text-details
lnk-text-details Output lnk-file-status
lnk-retail
lnk-onhand
lnk-sold
Service DeleteRecord lnk-function = 3 Service Add-Record lnk-function = 2
Input lnk-stockno Output lnk-file-status
Output lnk-file-status lnk-stockno
lnk-text-details
lnk-retail
lnk-onhand
lnk-sold
Interface Mapping Toolkit (IMTK)
COM
Web Services
JavaApplication
Server
EnterpriseServer
EJBInterface
TestClient
Non-ESWindows only
Generation Deployment
COBOLInterface
(Linkage Section)
Direct COBOL Web Services
The ability to Create, Consume and Deploy COBOL Web services without requiring any 3rd Party Software
Create• New tool in Net Express 4.0 called the Interface Mapping Toolkit
builds a Web service from an existing COBOL Interface
Consume• COBOL can access a Web service built not only with Net
Express but say .NET or IBM WebSphere
Deploy• Direct COBOL Web services can be deployed with Enterprise
Server
Complete COBOL Web services Solution
‘Direct’ COBOL Web services
Net Express/Server Express Enterprise Server
SOAPListener
Workload
Disp
atcher
No Java footprint on the server
ServerPool
Users COBOLprograms
Decode
Generated by Interface Mapping
Toolkit
SOAP/HTTPInsuranceBroker
application
InsuranceBroker
application
COBOLProgram
Checker
InterfaceMapper
IDTIDT Map. XMLMap. XML
INTINT Data Dict. Data Dict. XMLXML
EJB EJB ClassesClasses
EJB, JSP and Servlet Generator
ServletServletClassesClasses
JSPJSP
Mapping COBOL Programs as EJB
Enterprise Server defines a COBOL Container for UOW transaction execution• Follows the ‘Container Managed Transaction’ model
• No explicit syntax required
• Transaction characteristics defined when deployed
Web services transactions are single-phase stateless transactions
Supports Micro Focus ISAM and ‘leading’ RDBMS
Acts as a resource manager to J2EE XA transaction protocols
Enterprise Server –Transaction Processing
COBOL Inside the .NET Framework
Net E
xpress 5.0
Visu
al Stu
dio 2005
COBOL C# VB.NET …
MSIL (Intermediate Language)
.NET Framework 2.0
FrameworkClasses ADO.NET Winforms Webforms
Win32
COBOL Development COBOL Deployment
Com
mon
Lan
guage R
un
time
Micro F
ocus
Ap
plication
Server
COBOL – an equal player in .NETCOBOL – an equal player in .NETCOBOL generates IL as other Microsoft languagesCOBOL generates IL as other Microsoft languagesCOBOL is deployed inside the .NET Framework under the CLRCOBOL is deployed inside the .NET Framework under the CLRCOBOL gains access to Framework classes and functionalityCOBOL gains access to Framework classes and functionality
Visual Studio 2005 Integration
•Productive COBOL Development and extension with Visual Studio
•Develop composite .NET COBOL/C#/VB.NET applications using same IDE
•Access .NET Framework from COBOL
COBOL compiles to managed or verifiable code
Solution contains multiple projects, one for each programming language involved. This solution involves COBOL and C#
Colorization in COBOL editor distinguishes reserved words, data names, comments, etc.
Intellisense lists method-name choices
.NET WinForms and WebForms in COBOL
Use Visual Studio Painter to create and maintain windows forms and web pages to interact with existing COBOL programs
Win Form painter with Properties dialog box
COBOL code is created to support the Win Form.
Solution Explorer shows entire web site
Web Form screen designer
Toolbox for adding controls to Web form
COBOL code behind the Web form
Web Form with data during execution
Win Form with data during program execution.
Create, Reuse and Extend
Reuse existing COBOL Business logic in .NET
Use Procedural or Object Oriented COBOL under .NET
Extend COBOL applications to utilize .NET functionality- Access to .NET Framework Classes
program-id. ShowMessageBox as "ShowMessageBox". environment division. configuration section. repository. class Message-Box as "System.Windows.Forms.MessageBox".
data division. working-storage section. procedure division. invoke Message-Box "Show" using "Hello COBOL World". end program ShowMessageBox.
Connected and Disconnected Data Access
ADO.NET provides for Connected and Disconnected data accessDisconnected data access liberates SQL application from a continual connection to a databaseEnhance the performance of web and other applicationsShare data across composite applications Make ISAM and other data available to non-COBOL applicationsExport data to XML
ApplicationRead / Write RDB ISAM
Connected Data Access
Application
RDB ISAM
Disconnected Data Access
COBOL, C#, VS.NET Program
COBOL, C#, VB.NET Program
Dataset(s)
Download
Upload
Expose COBOL as Web Services
Use Visual Studio .NET to create and extend COBOL applications
CLASS-ID. Stock INHERITS WEBSERVICE. REPOSITORY. CLASS WEBSERVICE AS "System.Web.Services.WebService" CLASS WEBMETHOD AS "System.Web.Services.WebMethodAttribute". OBJECT. PROCEDURE DIVISION. METHOD-ID. StockQuote CUSTOM-ATTRIBUTE IS WEBMETHOD.
Microsoft IIS
AS
P.N
ET
CO
BO
L
COBOLApplication