310 likes | 716 Views
COBOL and Distributed Architecture. Boris Gilad COBOL Solutions Manager Boris.gilad@ness.com borisg@cobol.co.il. 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.
E N D
COBOL and Distributed Architecture Boris Gilad COBOL Solutions Manager Boris.gilad@ness.com borisg@cobol.co.il
Agenda • Object Oriented COBOL • COBOL - Java interaction • COBOL and XML • COBOL and Web Services • COBOL and EJB • COBOL.Net • Q & A
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 COBOL Record CBL2XML XML 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 = 1Service Add-Record lnk-function = 2 Input lnk-stocknoInput lnk-stockno Output lnk-file-status lnk-text-details lnk-text-detailsOutput lnk-file-status lnk-retail lnk-onhand lnk-sold Service DeleteRecord lnk-function = 3Service Add-Record lnk-function = 2 Input lnk-stocknoOutput lnk-file-status Output lnk-file-statuslnk-stockno lnk-text-details lnk-retail lnk-onhand lnk-sold
EJB Interface Interface Mapping Toolkit (IMTK) COM Non-ES Windows only Deployment Generation Java Application Server Web Services COBOL Interface (Linkage Section) Enterprise Server Test Client
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
Users COBOL programs Server Pool Decode ‘Direct’ COBOL Web services Net Express/Server Express Enterprise Server Insurance Broker application Workload Dispatcher SOAP Listener SOAP/HTTP Generated by Interface Mapping Toolkit No Java footprint on the server
IDT INT EJB Classes JSP Servlet Classes Data Dict. XML Mapping COBOL Programs as EJB Interface Mapper COBOL Program Map. XML EJB, JSP and Servlet Generator Checker
Enterprise Server –Transaction Processing • 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
COBOL C# VB.NET … MSIL (Intermediate Language) Micro Focus Application Server Common Language Runtime Net Express 5.0 Visual Studio 2005 .NET Framework 2.0 Framework Classes ADO.NET Winforms Webforms Win32 COBOL Development COBOL Deployment COBOL Inside the .NET Framework • COBOL – an equal player in .NET • COBOL generates IL as other Microsoft languages • COBOL is deployed inside the .NET Framework under the CLR • COBOL gains access to Framework classes and functionality
Visual Studio 2005 Integration Colorization in COBOL editor distinguishes reserved words, data names, comments, etc. Intellisense lists method-name choices • 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#
.NET WinForms and WebForms in COBOL Win Form painter with Properties dialog box COBOL code is created to support the Win Form. Use Visual Studio Painter to create and maintain windows forms and web pages to interact with existing COBOL programs Win Form with data during program execution. 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
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 Data Access RDB ISAM Application Read / Write Disconnected Data Access Application COBOL, C#, VS.NET Program RDB ISAM Download Dataset(s) Upload COBOL, C#, VB.NET Program Connected and Disconnected Data Access • ADO.NET provides for Connected and Disconnected data access • Disconnected data access liberates SQL application from a continual connection to a database • Enhance the performance of web and other applications • Share data across composite applications • Make ISAM and other data available to non-COBOLapplications • Export data to XML
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 ASP.NET COBOL COBOL Application
Summary • ?????????????? ????? • ???????????? • ????????????????????? • ?????????????? • ?????????????
VIVA COBOL ! Thank You