SlideShare a Scribd company logo
1 of 26
Download to read offline
CS266 Software Reverse Engineering (SRE)
Reengineering and Reuse of Legacy Software
Teodoro (Ted) Cipresso, teodoro.cipresso@sjsu.edu
Department of Computer Science
San José State University
Spring 2015
The information in this presentation is taken from the thesis “Software reverse engineering education”
available at http://scholarworks.sjsu.edu/etd_theses/3734/ where all citations can be found.
2
Reengineering and Reuse of Legacy Software
Introduction, Motivation, and Considerations
 If good development practices were followed, legacy software is typically
composed of three layers [5]:
Layers of a well-structured legacy software application.
3
Reengineering and Reuse of Legacy Software
Introduction, Motivation, and Considerations
 Legacy applications that are not sufficiently componentized, such that their
general organization resembles the three layers, are not good candidates for
reengineering and reuse.
 The most widely accepted technique to reuse legacy application components is
that of Wrappering [5], where a new piece of code provides an interface to a
legacy application component or layer without requiring code changes to it.
 Typically, candidate applications should be well-structured such that the
business logic can be isolated, encapsulated, and made into reusable
components.
4
Reengineering and Reuse of Legacy Software
Introduction, Motivation, and Considerations
 Unless enough of an application's source code remains such that it's possible to
identify the names of reusable entry points (procedures) and their I/O data
structures, attempting to reuse the application may be difficult.
 While it is possible to learn the names of entry points that have been explicitly
exported by an application in the case of a DLL, the names don't indicate the
layout of the expected I/O data structures.
 One way to discover the entry points and I/O data structures in legacy machine
code is to read the source code of other applications which depend on it.
5
Reengineering and Reuse of Legacy Software
COBOL and “Legacy” Languages
 The COBOL programming language is most often associated with legacy
software applications.
 Normally, COBOL programs have a single entry point; additional “alternate”
entry points are rare.
 Legacy COBOL programs often include functional discriminators in their I/O
data structures.
Mapping legacy functional discriminators to an object-oriented design.
6
Reengineering and Reuse of Legacy Software
Reuse of Code in the Business Logic Layer
 In a real-world situation, we would be looking to reuse legacy components
whose machine code is the result of thousands of lines of high-level language
statements (COBOL) that implement a particular business process.
 Since our focus is more on reuse and reengineering of legacy code at a basic
level, it's not necessary to encumber ourselves with a very large program in
order to learn strategies for reuse and reengineering.
 Therefore we consider a small COBOL “calculator” that we wish to make
reusable from Java. This program is assumed to be something from the
business logic layer.
7
Reengineering and Reuse of Legacy Software
Sample COBOL Business Logic Component
01: ******************************************************************
02: ** Simple COBOL program that performs integer arithmetic **
03: ******************************************************************
04: IDENTIFICATION DIVISION.
05: PROGRAM-ID. 'SMPLCALC'.
06: DATA DIVISION.
07: WORKING-STORAGE SECTION.
08: 77 MSG-NUMERIC-OVERFLOW PIC X(25)
09: VALUE 'Numeric overflow occurred'.
10: 77 MSG-SUCCESSFUL PIC X(22)
11: VALUE 'Completed successfully'.
12: LINKAGE SECTION.
13: * Input/Output data structure
14: 01 SMPLCALC-INTERFACE.
15: 02 SI-OPERAND-1 PIC S9(9) COMP-5.
16: 02 SI-OPERAND-2 PIC S9(9) COMP-5.
17: 02 SI-OPERATION PIC X.
18: 88 DO-ADD VALUE '+'.
19: 88 DO-SUB VALUE '-'.
20: 88 DO-MUL VALUE '*'.
21: 02 SI-RESULT PIC S9(18) COMP-3.
22: 02 SI-RESULT-MESSAGE PIC X(128).
23: PROCEDURE DIVISION USING
24: BY REFERENCE SMPLCALC-INTERFACE.
25: MAINLINE SECTION.
26: * Perform requested arithmetic
8
Reengineering and Reuse of Legacy Software
Sample COBOL Business Logic Component
27: INITIALIZE SI-RESULT SI-RESULT-MESSAGE
28: EVALUATE TRUE
29: WHEN DO-ADD
30: COMPUTE SI-RESULT = SI-OPERAND-1 + SI-OPERAND-2
31: ON SIZE ERROR
32: PERFORM HANDLE-SIZE-ERROR
33: END-COMPUTE
34: WHEN DO-SUB
35: COMPUTE SI-RESULT = SI-OPERAND-1 - SI-OPERAND-2
36: ON SIZE ERROR
37: PERFORM HANDLE-SIZE-ERROR
38: END-COMPUTE
39: WHEN DO-MUL
40: COMPUTE SI-RESULT = SI-OPERAND-1 * SI-OPERAND-2
41: ON SIZE ERROR
42: PERFORM HANDLE-SIZE-ERROR
43: END-COMPUTE
44: END-EVALUATE
45: * Successful return
46: MOVE MSG-SUCCESSFUL TO SI-RESULT-MESSAGE
47: MOVE 2 TO RETURN-CODE
48: GOBACK
49: .
9
Reengineering and Reuse of Legacy Software
Modernizing Business Logic Components
 Many commercial tools support importing a COBOL data structure and
generating Java marshalling classes.
 These marshalling classes are intended to be used with the J2EE Connector
Architecture (JCA) where a Java application wrappers a legacy software
application.
Example JCA implementation for accessing a legacy application.
10
Reengineering and Reuse of Legacy Software
Modernizing Business Logic Components (cont’d)
 A popular alternative to using the JCA architecture to reengineer and reuse
legacy applications is to implement a Service Oriented Architecture (SOA).
 SOA components become capable of communicating without the tight and
fragile coupling of traditional binary interfaces because they are wrappered with
a platform-neutral interface such as XML and Web services.
 When XML is used as envisioned, all data, both of type character and numeric
are represented as printable text—completely divorced from any platform
specific representation or encoding.
11
Reengineering and Reuse of Legacy Software
Modernizing Business Logic Components (cont’d)
 The net effect of this is that two entities or programs can interact without
having to know the data structures that comprise each other's binary interface.
 Of course, the XML that is exchanged cannot be arbitrary, so industry standards
such as XML Schema (XSD), and Web Services Definition Language (WSDL) fill
this gap.
 A Web service is considered to be WS-I compliant, or generally interoperable, if
it meets many criteria, one of which is the use of XML for the input and output
of each operation exposed by service.
12
Reengineering and Reuse of Legacy Software
Software Reengineering/Reuse Exercise
 This particular requirement of WS-I where XML is the interoperable interface of
choice, sets the stage for a meaningful exercise.
 A Legacy Software Reengineering and Reuse Exercise was developed to
demonstrate wrapping a COBOL program so that is reusable from Java using
XML in a local environment.
 In the exercise, one is asked to create a language neutral XML interface to the
COBOL calculator program and invoke it from a Java program, which
incidentally makes it reusable from other Java programs.
13
Reengineering and Reuse of Legacy Software
Software Reengineering/Reuse Exercise (cont’d)
 Overview of the architecture for the exercise:
Architecture for legacy application reengineering and reuse from Java.
14
Reengineering and Reuse of Legacy Software
Software Reengineering/Reuse Exercise (cont’d)
 Steps in the reengineering and reuse exercise:
 Create an XML Schema which represents all of the data in the SMPLCALC-
INTERFACE COBOL data structure.
 Write a Java interface ISimpleCalculator.java for three computation types
supported by SMPLCALC.cbl.
 Write a Java class JSimpleCalculator.java that implements the interface
defined in ISimpleCalculator.java and provides a user interface.
 Use the Java command-line utility xjc, in combination with the XML
Schema, generate Java to XML marshalling code (JAXB).
15
Reengineering and Reuse of Legacy Software
Software Reengineering/Reuse Exercise (cont’d)
 Steps in the reengineering and reuse exercise (cont’d):
 Write a small C/C++ JNI program Java2CblXmlBridge.cpp which exports a
method Java2SmplCalc that:
 Invokes XML2CALC.cbl, passing the XML document received from
JSimpleCalculator.java.
 Returns the XML generated by XML2CALC.cbl to JSimpleCalculator.java.
16
Reengineering and Reuse of Legacy Software
Software Reengineering/Reuse Exercise (cont’d)
 Steps in the reengineering and reuse exercise (cont’d):
 Write a COBOL program XML2CALC.cbl:
 Marshalls XML from Java2CblXmlBridge.cpp into SMPLCALC-INTERFACE.
 Invokes SMPLCALC.cbl, passing SMPLCALC-INTERFACE by reference.
 Marshalls SMPLCALC-INTERFACE back to XML before returning to
Java2CblXmlBridge.cpp.
 Compile XML2CALC.cbl and link it with the object code for SMPLCALC.cbl
(SMPLCALC.obj).
17
Reengineering and Reuse of Legacy Software
Software Reengineering/Reuse Exercise (cont’d)
 Steps in the reengineering and reuse exercise (cont’d):
 Create a DLL to be loaded by JSimpleCalculator.java by compiling and
linking Java2CblXmlBridge.cpp with the object code for XML2CALC.cbl.
 Update JSimpleCalculator.java to use the JAXB marshalling code to
send/receive XML through the JNI layer and display the results.
18
Reengineering and Reuse of Legacy Software
Software Reengineering/Reuse Exercise (cont’d)
 Highlights of the solution code:
 SimpleCalculator.xsd
<element name="SI-OPERAND-1">
<simpleType>
<restriction base="integer">
<totalDigits value="9" />
</restriction>
</simpleType>
</element>
. . .
<element name="SI-OPERATION">
<simpleType>
<restriction base="string">
<enumeration value="+" />
<enumeration value="-" />
<enumeration value="*" />
</restriction>
</simpleType>
</element>
19
Reengineering and Reuse of Legacy Software
Software Reengineering/Reuse Exercise (cont’d)
 Highlights of the solution code (cont’d):
 ISimpleCalculator.java
20
Reengineering and Reuse of Legacy Software
Software Reengineering/Reuse Exercise (cont’d)
 Highlights of the solution code (cont’d):
 JSimpleCalculator.java
21
Reengineering and Reuse of Legacy Software
Software Reengineering/Reuse Exercise (cont’d)
 Highlights of the solution code (cont’d):
 JSimpleCalculator.java (cont’d)
22
Reengineering and Reuse of Legacy Software
Software Reengineering/Reuse Exercise (cont’d)
 Highlights of the solution code (cont’d):
 Java2CblXmlBridge.c
23
Reengineering and Reuse of Legacy Software
Software Reengineering/Reuse Exercise (cont’d)
 Highlights of the solution code (cont’d):
 XML2CALC.cbl
24
Results (cont’d)
Reengineering and Reuse of Legacy Software (cont’d)
 Sample run of solution code:
Figure 55. Reuse of COBOL from Java using JAXB, JNI, and COBOL XML Support.
25
Reengineering and Reuse of Legacy Software
Software Reengineering/Reuse Exercise (cont’d)
 Sample run of solution code:
Reuse of COBOL from Java using JAXB, JNI, and COBOL XML Support.
26

More Related Content

What's hot

Overlapping optimization with parsing through metagrammars
Overlapping optimization with parsing through metagrammarsOverlapping optimization with parsing through metagrammars
Overlapping optimization with parsing through metagrammarsIAEME Publication
 
Capital Investment Industrial Modeling Framework - IMPRESS
Capital Investment Industrial Modeling Framework - IMPRESSCapital Investment Industrial Modeling Framework - IMPRESS
Capital Investment Industrial Modeling Framework - IMPRESSAlkis Vazacopoulos
 
Binary code obfuscation through c++ template meta programming
Binary code obfuscation through c++ template meta programmingBinary code obfuscation through c++ template meta programming
Binary code obfuscation through c++ template meta programmingnong_dan
 
MAPPING SCDL/BPEL TO ADA FOR FORMAL VERIFICATION OF THE BEHAVIORAL PROPERTIES...
MAPPING SCDL/BPEL TO ADA FOR FORMAL VERIFICATION OF THE BEHAVIORAL PROPERTIES...MAPPING SCDL/BPEL TO ADA FOR FORMAL VERIFICATION OF THE BEHAVIORAL PROPERTIES...
MAPPING SCDL/BPEL TO ADA FOR FORMAL VERIFICATION OF THE BEHAVIORAL PROPERTIES...ijwscjournal
 
C Programming and Coding Standards, Learn C Programming
C Programming and Coding Standards, Learn C ProgrammingC Programming and Coding Standards, Learn C Programming
C Programming and Coding Standards, Learn C ProgrammingTonex
 
Prograamção Paralela Baseada em Componentes (Introduzido o Modelo #)
Prograamção Paralela Baseada em Componentes (Introduzido o Modelo #)Prograamção Paralela Baseada em Componentes (Introduzido o Modelo #)
Prograamção Paralela Baseada em Componentes (Introduzido o Modelo #)Heron Carvalho
 
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTTC programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTTBatra Centre
 
Cbt component based technology architectures
Cbt   component based technology architecturesCbt   component based technology architectures
Cbt component based technology architecturesSaransh Garg
 
Component based models and technology
Component based models and technologyComponent based models and technology
Component based models and technologySaransh Garg
 
Component based models and technology
Component based models and technologyComponent based models and technology
Component based models and technologyMayukh Maitra
 
Staroletov Design by Contract, verification of Cyber-physical systems
Staroletov Design by Contract, verification of Cyber-physical systemsStaroletov Design by Contract, verification of Cyber-physical systems
Staroletov Design by Contract, verification of Cyber-physical systemsSergey Staroletov
 
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...NicheTech Com. Solutions Pvt. Ltd.
 
Kroening et al, v2c a verilog to c translator
Kroening et al, v2c   a verilog to c translatorKroening et al, v2c   a verilog to c translator
Kroening et al, v2c a verilog to c translatorsce,bhopal
 
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
C notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit orderC notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit order
C notes by m v b reddy(gitam)imp notes all units notes 5 unit orderMalikireddy Bramhananda Reddy
 
MODEL DRIVEN ARCHITECTURE, CONTROL SYSTEMS AND ECLIPSE
MODEL DRIVEN ARCHITECTURE, CONTROL SYSTEMS AND ECLIPSEMODEL DRIVEN ARCHITECTURE, CONTROL SYSTEMS AND ECLIPSE
MODEL DRIVEN ARCHITECTURE, CONTROL SYSTEMS AND ECLIPSEAnže Vodovnik
 

What's hot (20)

Overlapping optimization with parsing through metagrammars
Overlapping optimization with parsing through metagrammarsOverlapping optimization with parsing through metagrammars
Overlapping optimization with parsing through metagrammars
 
Capital Investment Industrial Modeling Framework - IMPRESS
Capital Investment Industrial Modeling Framework - IMPRESSCapital Investment Industrial Modeling Framework - IMPRESS
Capital Investment Industrial Modeling Framework - IMPRESS
 
Binary code obfuscation through c++ template meta programming
Binary code obfuscation through c++ template meta programmingBinary code obfuscation through c++ template meta programming
Binary code obfuscation through c++ template meta programming
 
MAPPING SCDL/BPEL TO ADA FOR FORMAL VERIFICATION OF THE BEHAVIORAL PROPERTIES...
MAPPING SCDL/BPEL TO ADA FOR FORMAL VERIFICATION OF THE BEHAVIORAL PROPERTIES...MAPPING SCDL/BPEL TO ADA FOR FORMAL VERIFICATION OF THE BEHAVIORAL PROPERTIES...
MAPPING SCDL/BPEL TO ADA FOR FORMAL VERIFICATION OF THE BEHAVIORAL PROPERTIES...
 
C Programming and Coding Standards, Learn C Programming
C Programming and Coding Standards, Learn C ProgrammingC Programming and Coding Standards, Learn C Programming
C Programming and Coding Standards, Learn C Programming
 
Abc c program
Abc c programAbc c program
Abc c program
 
Prograamção Paralela Baseada em Componentes (Introduzido o Modelo #)
Prograamção Paralela Baseada em Componentes (Introduzido o Modelo #)Prograamção Paralela Baseada em Componentes (Introduzido o Modelo #)
Prograamção Paralela Baseada em Componentes (Introduzido o Modelo #)
 
Part 1
Part 1Part 1
Part 1
 
Pooling optimization problem
Pooling optimization problemPooling optimization problem
Pooling optimization problem
 
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTTC programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
 
Cbt component based technology architectures
Cbt   component based technology architecturesCbt   component based technology architectures
Cbt component based technology architectures
 
Component based models and technology
Component based models and technologyComponent based models and technology
Component based models and technology
 
Component based models and technology
Component based models and technologyComponent based models and technology
Component based models and technology
 
Staroletov Design by Contract, verification of Cyber-physical systems
Staroletov Design by Contract, verification of Cyber-physical systemsStaroletov Design by Contract, verification of Cyber-physical systems
Staroletov Design by Contract, verification of Cyber-physical systems
 
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
 
Unit4
Unit4Unit4
Unit4
 
Kroening et al, v2c a verilog to c translator
Kroening et al, v2c   a verilog to c translatorKroening et al, v2c   a verilog to c translator
Kroening et al, v2c a verilog to c translator
 
Chiranjeevi_QA Engg.
Chiranjeevi_QA Engg.Chiranjeevi_QA Engg.
Chiranjeevi_QA Engg.
 
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
C notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit orderC notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit order
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
 
MODEL DRIVEN ARCHITECTURE, CONTROL SYSTEMS AND ECLIPSE
MODEL DRIVEN ARCHITECTURE, CONTROL SYSTEMS AND ECLIPSEMODEL DRIVEN ARCHITECTURE, CONTROL SYSTEMS AND ECLIPSE
MODEL DRIVEN ARCHITECTURE, CONTROL SYSTEMS AND ECLIPSE
 

Viewers also liked

Applying Anti-Reversing Techniques to Machine Code
Applying Anti-Reversing Techniques to Machine CodeApplying Anti-Reversing Techniques to Machine Code
Applying Anti-Reversing Techniques to Machine CodeTeodoro Cipresso
 
Why z/OS is a Great Platform for Developing and Hosting APIs
Why z/OS is a Great Platform for Developing and Hosting APIsWhy z/OS is a Great Platform for Developing and Hosting APIs
Why z/OS is a Great Platform for Developing and Hosting APIsTeodoro Cipresso
 
Make Your API Catalog Essential with z/OS Connect EE
Make Your API Catalog Essential with z/OS Connect EEMake Your API Catalog Essential with z/OS Connect EE
Make Your API Catalog Essential with z/OS Connect EETeodoro Cipresso
 
Innovate 2014: Get an A+ on Testing Your Enterprise Applications with Rationa...
Innovate 2014: Get an A+ on Testing Your Enterprise Applications with Rationa...Innovate 2014: Get an A+ on Testing Your Enterprise Applications with Rationa...
Innovate 2014: Get an A+ on Testing Your Enterprise Applications with Rationa...Teodoro Cipresso
 
Reversing and Patching Java Bytecode
Reversing and Patching Java BytecodeReversing and Patching Java Bytecode
Reversing and Patching Java BytecodeTeodoro Cipresso
 
Bitonic Sort in Shared SIMD Array Processor
Bitonic Sort in Shared SIMD Array ProcessorBitonic Sort in Shared SIMD Array Processor
Bitonic Sort in Shared SIMD Array ProcessorAsanka Dilruk
 
Identifying, Monitoring, and Reporting Malware
Identifying, Monitoring, and Reporting MalwareIdentifying, Monitoring, and Reporting Malware
Identifying, Monitoring, and Reporting MalwareTeodoro Cipresso
 
Introduction to Software Reverse Engineering
Introduction to Software Reverse EngineeringIntroduction to Software Reverse Engineering
Introduction to Software Reverse EngineeringTeodoro Cipresso
 

Viewers also liked (10)

Applying Anti-Reversing Techniques to Machine Code
Applying Anti-Reversing Techniques to Machine CodeApplying Anti-Reversing Techniques to Machine Code
Applying Anti-Reversing Techniques to Machine Code
 
Why z/OS is a Great Platform for Developing and Hosting APIs
Why z/OS is a Great Platform for Developing and Hosting APIsWhy z/OS is a Great Platform for Developing and Hosting APIs
Why z/OS is a Great Platform for Developing and Hosting APIs
 
Make Your API Catalog Essential with z/OS Connect EE
Make Your API Catalog Essential with z/OS Connect EEMake Your API Catalog Essential with z/OS Connect EE
Make Your API Catalog Essential with z/OS Connect EE
 
Innovate 2014: Get an A+ on Testing Your Enterprise Applications with Rationa...
Innovate 2014: Get an A+ on Testing Your Enterprise Applications with Rationa...Innovate 2014: Get an A+ on Testing Your Enterprise Applications with Rationa...
Innovate 2014: Get an A+ on Testing Your Enterprise Applications with Rationa...
 
Reversing and Patching Java Bytecode
Reversing and Patching Java BytecodeReversing and Patching Java Bytecode
Reversing and Patching Java Bytecode
 
Bitonic Sort in Shared SIMD Array Processor
Bitonic Sort in Shared SIMD Array ProcessorBitonic Sort in Shared SIMD Array Processor
Bitonic Sort in Shared SIMD Array Processor
 
Identifying, Monitoring, and Reporting Malware
Identifying, Monitoring, and Reporting MalwareIdentifying, Monitoring, and Reporting Malware
Identifying, Monitoring, and Reporting Malware
 
Introduction to Software Reverse Engineering
Introduction to Software Reverse EngineeringIntroduction to Software Reverse Engineering
Introduction to Software Reverse Engineering
 
Array Processor
Array ProcessorArray Processor
Array Processor
 
CO Module 5
CO Module 5CO Module 5
CO Module 5
 

Similar to Reengineering and Reuse of Legacy Software

Restructuring functions with low cohesion
Restructuring functions with low cohesionRestructuring functions with low cohesion
Restructuring functions with low cohesionAditya Kumar Ghosh
 
Software Engineering Fundamentals in Computer Science
Software Engineering Fundamentals in Computer ScienceSoftware Engineering Fundamentals in Computer Science
Software Engineering Fundamentals in Computer ScienceArti Parab Academics
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principlesdeonpmeyer
 
Function Overloading,Inline Function and Recursion in C++ By Faisal Shahzad
Function Overloading,Inline Function and Recursion in C++ By Faisal ShahzadFunction Overloading,Inline Function and Recursion in C++ By Faisal Shahzad
Function Overloading,Inline Function and Recursion in C++ By Faisal ShahzadFaisal Shehzad
 
379008-rc217-functionalprogramming
379008-rc217-functionalprogramming379008-rc217-functionalprogramming
379008-rc217-functionalprogrammingLuis Atencio
 
International Journal of Computational Engineering Research(IJCER)
 International Journal of Computational Engineering Research(IJCER)  International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER) ijceronline
 
IRJET- Generation of HTML Code using Machine Learning Techniques from Mock-Up...
IRJET- Generation of HTML Code using Machine Learning Techniques from Mock-Up...IRJET- Generation of HTML Code using Machine Learning Techniques from Mock-Up...
IRJET- Generation of HTML Code using Machine Learning Techniques from Mock-Up...IRJET Journal
 
186 devlin p-poster(2)
186 devlin p-poster(2)186 devlin p-poster(2)
186 devlin p-poster(2)vaidehi87
 
ABC Architecture A New Approach To Build Reusable And Adaptable Business Tie...
ABC Architecture  A New Approach To Build Reusable And Adaptable Business Tie...ABC Architecture  A New Approach To Build Reusable And Adaptable Business Tie...
ABC Architecture A New Approach To Build Reusable And Adaptable Business Tie...Joshua Gorinson
 
Phase Five Individual Project03-11-2016Revision .docx
Phase Five Individual Project03-11-2016Revision .docxPhase Five Individual Project03-11-2016Revision .docx
Phase Five Individual Project03-11-2016Revision .docxmattjtoni51554
 
Object-Oriented Application Frameworks
Object-Oriented Application FrameworksObject-Oriented Application Frameworks
Object-Oriented Application Frameworkskim.mens
 
Cocoa encyclopedia
Cocoa encyclopediaCocoa encyclopedia
Cocoa encyclopediaAlex Ali
 
Book management system
Book management systemBook management system
Book management systemSHARDA SHARAN
 
Probe Debugging
Probe DebuggingProbe Debugging
Probe DebuggingESUG
 

Similar to Reengineering and Reuse of Legacy Software (20)

Restructuring functions with low cohesion
Restructuring functions with low cohesionRestructuring functions with low cohesion
Restructuring functions with low cohesion
 
OO analysis_Lecture12.ppt
OO analysis_Lecture12.pptOO analysis_Lecture12.ppt
OO analysis_Lecture12.ppt
 
cost-estimation-tutorial
cost-estimation-tutorialcost-estimation-tutorial
cost-estimation-tutorial
 
Software Engineering Fundamentals in Computer Science
Software Engineering Fundamentals in Computer ScienceSoftware Engineering Fundamentals in Computer Science
Software Engineering Fundamentals in Computer Science
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principles
 
Function Overloading,Inline Function and Recursion in C++ By Faisal Shahzad
Function Overloading,Inline Function and Recursion in C++ By Faisal ShahzadFunction Overloading,Inline Function and Recursion in C++ By Faisal Shahzad
Function Overloading,Inline Function and Recursion in C++ By Faisal Shahzad
 
379008-rc217-functionalprogramming
379008-rc217-functionalprogramming379008-rc217-functionalprogramming
379008-rc217-functionalprogramming
 
Intro-Soft-Engg-2.pptx
Intro-Soft-Engg-2.pptxIntro-Soft-Engg-2.pptx
Intro-Soft-Engg-2.pptx
 
Mkl mic lab_0
Mkl mic lab_0Mkl mic lab_0
Mkl mic lab_0
 
International Journal of Computational Engineering Research(IJCER)
 International Journal of Computational Engineering Research(IJCER)  International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)
 
Software Reengineering
Software ReengineeringSoftware Reengineering
Software Reengineering
 
IRJET- Generation of HTML Code using Machine Learning Techniques from Mock-Up...
IRJET- Generation of HTML Code using Machine Learning Techniques from Mock-Up...IRJET- Generation of HTML Code using Machine Learning Techniques from Mock-Up...
IRJET- Generation of HTML Code using Machine Learning Techniques from Mock-Up...
 
186 devlin p-poster(2)
186 devlin p-poster(2)186 devlin p-poster(2)
186 devlin p-poster(2)
 
ABC Architecture A New Approach To Build Reusable And Adaptable Business Tie...
ABC Architecture  A New Approach To Build Reusable And Adaptable Business Tie...ABC Architecture  A New Approach To Build Reusable And Adaptable Business Tie...
ABC Architecture A New Approach To Build Reusable And Adaptable Business Tie...
 
Phase Five Individual Project03-11-2016Revision .docx
Phase Five Individual Project03-11-2016Revision .docxPhase Five Individual Project03-11-2016Revision .docx
Phase Five Individual Project03-11-2016Revision .docx
 
Object-Oriented Application Frameworks
Object-Oriented Application FrameworksObject-Oriented Application Frameworks
Object-Oriented Application Frameworks
 
Cocoa encyclopedia
Cocoa encyclopediaCocoa encyclopedia
Cocoa encyclopedia
 
X-2E Modernize
X-2E ModernizeX-2E Modernize
X-2E Modernize
 
Book management system
Book management systemBook management system
Book management system
 
Probe Debugging
Probe DebuggingProbe Debugging
Probe Debugging
 

Recently uploaded

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 

Recently uploaded (20)

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 

Reengineering and Reuse of Legacy Software

  • 1. CS266 Software Reverse Engineering (SRE) Reengineering and Reuse of Legacy Software Teodoro (Ted) Cipresso, teodoro.cipresso@sjsu.edu Department of Computer Science San José State University Spring 2015 The information in this presentation is taken from the thesis “Software reverse engineering education” available at http://scholarworks.sjsu.edu/etd_theses/3734/ where all citations can be found.
  • 2. 2 Reengineering and Reuse of Legacy Software Introduction, Motivation, and Considerations  If good development practices were followed, legacy software is typically composed of three layers [5]: Layers of a well-structured legacy software application.
  • 3. 3 Reengineering and Reuse of Legacy Software Introduction, Motivation, and Considerations  Legacy applications that are not sufficiently componentized, such that their general organization resembles the three layers, are not good candidates for reengineering and reuse.  The most widely accepted technique to reuse legacy application components is that of Wrappering [5], where a new piece of code provides an interface to a legacy application component or layer without requiring code changes to it.  Typically, candidate applications should be well-structured such that the business logic can be isolated, encapsulated, and made into reusable components.
  • 4. 4 Reengineering and Reuse of Legacy Software Introduction, Motivation, and Considerations  Unless enough of an application's source code remains such that it's possible to identify the names of reusable entry points (procedures) and their I/O data structures, attempting to reuse the application may be difficult.  While it is possible to learn the names of entry points that have been explicitly exported by an application in the case of a DLL, the names don't indicate the layout of the expected I/O data structures.  One way to discover the entry points and I/O data structures in legacy machine code is to read the source code of other applications which depend on it.
  • 5. 5 Reengineering and Reuse of Legacy Software COBOL and “Legacy” Languages  The COBOL programming language is most often associated with legacy software applications.  Normally, COBOL programs have a single entry point; additional “alternate” entry points are rare.  Legacy COBOL programs often include functional discriminators in their I/O data structures. Mapping legacy functional discriminators to an object-oriented design.
  • 6. 6 Reengineering and Reuse of Legacy Software Reuse of Code in the Business Logic Layer  In a real-world situation, we would be looking to reuse legacy components whose machine code is the result of thousands of lines of high-level language statements (COBOL) that implement a particular business process.  Since our focus is more on reuse and reengineering of legacy code at a basic level, it's not necessary to encumber ourselves with a very large program in order to learn strategies for reuse and reengineering.  Therefore we consider a small COBOL “calculator” that we wish to make reusable from Java. This program is assumed to be something from the business logic layer.
  • 7. 7 Reengineering and Reuse of Legacy Software Sample COBOL Business Logic Component 01: ****************************************************************** 02: ** Simple COBOL program that performs integer arithmetic ** 03: ****************************************************************** 04: IDENTIFICATION DIVISION. 05: PROGRAM-ID. 'SMPLCALC'. 06: DATA DIVISION. 07: WORKING-STORAGE SECTION. 08: 77 MSG-NUMERIC-OVERFLOW PIC X(25) 09: VALUE 'Numeric overflow occurred'. 10: 77 MSG-SUCCESSFUL PIC X(22) 11: VALUE 'Completed successfully'. 12: LINKAGE SECTION. 13: * Input/Output data structure 14: 01 SMPLCALC-INTERFACE. 15: 02 SI-OPERAND-1 PIC S9(9) COMP-5. 16: 02 SI-OPERAND-2 PIC S9(9) COMP-5. 17: 02 SI-OPERATION PIC X. 18: 88 DO-ADD VALUE '+'. 19: 88 DO-SUB VALUE '-'. 20: 88 DO-MUL VALUE '*'. 21: 02 SI-RESULT PIC S9(18) COMP-3. 22: 02 SI-RESULT-MESSAGE PIC X(128). 23: PROCEDURE DIVISION USING 24: BY REFERENCE SMPLCALC-INTERFACE. 25: MAINLINE SECTION. 26: * Perform requested arithmetic
  • 8. 8 Reengineering and Reuse of Legacy Software Sample COBOL Business Logic Component 27: INITIALIZE SI-RESULT SI-RESULT-MESSAGE 28: EVALUATE TRUE 29: WHEN DO-ADD 30: COMPUTE SI-RESULT = SI-OPERAND-1 + SI-OPERAND-2 31: ON SIZE ERROR 32: PERFORM HANDLE-SIZE-ERROR 33: END-COMPUTE 34: WHEN DO-SUB 35: COMPUTE SI-RESULT = SI-OPERAND-1 - SI-OPERAND-2 36: ON SIZE ERROR 37: PERFORM HANDLE-SIZE-ERROR 38: END-COMPUTE 39: WHEN DO-MUL 40: COMPUTE SI-RESULT = SI-OPERAND-1 * SI-OPERAND-2 41: ON SIZE ERROR 42: PERFORM HANDLE-SIZE-ERROR 43: END-COMPUTE 44: END-EVALUATE 45: * Successful return 46: MOVE MSG-SUCCESSFUL TO SI-RESULT-MESSAGE 47: MOVE 2 TO RETURN-CODE 48: GOBACK 49: .
  • 9. 9 Reengineering and Reuse of Legacy Software Modernizing Business Logic Components  Many commercial tools support importing a COBOL data structure and generating Java marshalling classes.  These marshalling classes are intended to be used with the J2EE Connector Architecture (JCA) where a Java application wrappers a legacy software application. Example JCA implementation for accessing a legacy application.
  • 10. 10 Reengineering and Reuse of Legacy Software Modernizing Business Logic Components (cont’d)  A popular alternative to using the JCA architecture to reengineer and reuse legacy applications is to implement a Service Oriented Architecture (SOA).  SOA components become capable of communicating without the tight and fragile coupling of traditional binary interfaces because they are wrappered with a platform-neutral interface such as XML and Web services.  When XML is used as envisioned, all data, both of type character and numeric are represented as printable text—completely divorced from any platform specific representation or encoding.
  • 11. 11 Reengineering and Reuse of Legacy Software Modernizing Business Logic Components (cont’d)  The net effect of this is that two entities or programs can interact without having to know the data structures that comprise each other's binary interface.  Of course, the XML that is exchanged cannot be arbitrary, so industry standards such as XML Schema (XSD), and Web Services Definition Language (WSDL) fill this gap.  A Web service is considered to be WS-I compliant, or generally interoperable, if it meets many criteria, one of which is the use of XML for the input and output of each operation exposed by service.
  • 12. 12 Reengineering and Reuse of Legacy Software Software Reengineering/Reuse Exercise  This particular requirement of WS-I where XML is the interoperable interface of choice, sets the stage for a meaningful exercise.  A Legacy Software Reengineering and Reuse Exercise was developed to demonstrate wrapping a COBOL program so that is reusable from Java using XML in a local environment.  In the exercise, one is asked to create a language neutral XML interface to the COBOL calculator program and invoke it from a Java program, which incidentally makes it reusable from other Java programs.
  • 13. 13 Reengineering and Reuse of Legacy Software Software Reengineering/Reuse Exercise (cont’d)  Overview of the architecture for the exercise: Architecture for legacy application reengineering and reuse from Java.
  • 14. 14 Reengineering and Reuse of Legacy Software Software Reengineering/Reuse Exercise (cont’d)  Steps in the reengineering and reuse exercise:  Create an XML Schema which represents all of the data in the SMPLCALC- INTERFACE COBOL data structure.  Write a Java interface ISimpleCalculator.java for three computation types supported by SMPLCALC.cbl.  Write a Java class JSimpleCalculator.java that implements the interface defined in ISimpleCalculator.java and provides a user interface.  Use the Java command-line utility xjc, in combination with the XML Schema, generate Java to XML marshalling code (JAXB).
  • 15. 15 Reengineering and Reuse of Legacy Software Software Reengineering/Reuse Exercise (cont’d)  Steps in the reengineering and reuse exercise (cont’d):  Write a small C/C++ JNI program Java2CblXmlBridge.cpp which exports a method Java2SmplCalc that:  Invokes XML2CALC.cbl, passing the XML document received from JSimpleCalculator.java.  Returns the XML generated by XML2CALC.cbl to JSimpleCalculator.java.
  • 16. 16 Reengineering and Reuse of Legacy Software Software Reengineering/Reuse Exercise (cont’d)  Steps in the reengineering and reuse exercise (cont’d):  Write a COBOL program XML2CALC.cbl:  Marshalls XML from Java2CblXmlBridge.cpp into SMPLCALC-INTERFACE.  Invokes SMPLCALC.cbl, passing SMPLCALC-INTERFACE by reference.  Marshalls SMPLCALC-INTERFACE back to XML before returning to Java2CblXmlBridge.cpp.  Compile XML2CALC.cbl and link it with the object code for SMPLCALC.cbl (SMPLCALC.obj).
  • 17. 17 Reengineering and Reuse of Legacy Software Software Reengineering/Reuse Exercise (cont’d)  Steps in the reengineering and reuse exercise (cont’d):  Create a DLL to be loaded by JSimpleCalculator.java by compiling and linking Java2CblXmlBridge.cpp with the object code for XML2CALC.cbl.  Update JSimpleCalculator.java to use the JAXB marshalling code to send/receive XML through the JNI layer and display the results.
  • 18. 18 Reengineering and Reuse of Legacy Software Software Reengineering/Reuse Exercise (cont’d)  Highlights of the solution code:  SimpleCalculator.xsd <element name="SI-OPERAND-1"> <simpleType> <restriction base="integer"> <totalDigits value="9" /> </restriction> </simpleType> </element> . . . <element name="SI-OPERATION"> <simpleType> <restriction base="string"> <enumeration value="+" /> <enumeration value="-" /> <enumeration value="*" /> </restriction> </simpleType> </element>
  • 19. 19 Reengineering and Reuse of Legacy Software Software Reengineering/Reuse Exercise (cont’d)  Highlights of the solution code (cont’d):  ISimpleCalculator.java
  • 20. 20 Reengineering and Reuse of Legacy Software Software Reengineering/Reuse Exercise (cont’d)  Highlights of the solution code (cont’d):  JSimpleCalculator.java
  • 21. 21 Reengineering and Reuse of Legacy Software Software Reengineering/Reuse Exercise (cont’d)  Highlights of the solution code (cont’d):  JSimpleCalculator.java (cont’d)
  • 22. 22 Reengineering and Reuse of Legacy Software Software Reengineering/Reuse Exercise (cont’d)  Highlights of the solution code (cont’d):  Java2CblXmlBridge.c
  • 23. 23 Reengineering and Reuse of Legacy Software Software Reengineering/Reuse Exercise (cont’d)  Highlights of the solution code (cont’d):  XML2CALC.cbl
  • 24. 24 Results (cont’d) Reengineering and Reuse of Legacy Software (cont’d)  Sample run of solution code: Figure 55. Reuse of COBOL from Java using JAXB, JNI, and COBOL XML Support.
  • 25. 25 Reengineering and Reuse of Legacy Software Software Reengineering/Reuse Exercise (cont’d)  Sample run of solution code: Reuse of COBOL from Java using JAXB, JNI, and COBOL XML Support.
  • 26. 26