converting your informix 4gl application to egl jin zhang software development manager ibm informix...
TRANSCRIPT
Converting Your Informix Converting Your Informix 4GL Application to EGL4GL Application to EGL
Jin ZhangJin ZhangSoftware Development Software Development
Manager IBMManager IBM
Informix User Forum 2005 Moving Forward With Informix
Atlanta, Georgia December 8-9, 2005
IBM Software Group / Information Management
© 2005 IBM Corporation Atlanta, December 2005
Agenda Rational Development Environment & EGL Overview
I4GL to EGL Conversion Utility
– Overview
– Conversion Process
– Post Conversion Steps
– Re-conversion, C-Interface, Reporting
– Deployment and Runtime
Demo: Converting I4GLDEMO to EGL
What Conversion Utility Cannot Do
Best Practices
Summary & Resources
Q&A
IBM Software Group / Information Management
© 2005 IBM Corporation3 Atlanta, December 2005
Rational Developer Products
IBM Rational Developer Products
Eclipse Java Development Tools
Rational Web Developer
Rational Software Architect
Rational Application Developer
func
tion
alit
y
IBM Software Group / Information Management
© 2005 IBM Corporation4 Atlanta, December 2005
EGL
A language as easy as I4GL to use and perform s/w development.
Provides an industry standard IDE (Rational Application developer) for developing EGL, Java, Web and COBOL applications.
Provides an enriched set of the same capabilities.
– Text user interface (Graphical & Curses based).
– Calls to “C” functions.
– SQL (embedded, dynamic and more).
– Interactive debugging capability.
– Powerful reporting capability.
– Command line based application development.
– Data types (all of I4GL and some more in addition).
IBM Software Group / Information Management
© 2005 IBM Corporation5 Atlanta, December 2005
EGL .....
In addition to the I4GL feature set, it provides
– Development and runtime capabilities for Windows platforms.
– More general programming capabilities.
– Web Application development and deployment.• Same business logic can be shared in both deployments.
– Multiple Database connectivity.• Uses JDBC and allows to connect to any DB.
– Service Oriented Architecture (Web Services).
– MQ Access.
– File I/O
– Provides for COBOL generation options (deployable in i-Series and z-Series).
– Calling out Java code from EGL.
– and more…
IBM Software Group / Information Management
© 2005 IBM Corporation6 Atlanta, December 2005
What is the I4GL EGL Conversion Solution ? Transform
– Convert Informix 4GL logic to EGL– Use Conversion Utility (part of Rational Application Developer) to automate
conversion– Convert on a program-by-program basis
Enhance– Leverage IBM Rational Software Development Platform– Enhance, maintain, debug EGL business logic– Expose transformed EGL programs as Web Services – Create new User Interfaces for TUI, GUI, Web and Portal– Integrate with existing applications, middleware and databases– Re-generate to support new databases or middleware
Deploy– EGL deployed as a 100% Java/J2EE application for WebSphere– Automatic EGL to Java conversion and deployment– Supports Windows, Linux, AIX, Solaris and HP, iSeries, zOS CICS , Batch, IMS
IBM Software Group / Information Management
© 2005 IBM Corporation7 Atlanta, December 2005
How is this going to be Done?
Using a wizard that comes as a plug-in to your environment.
– Directories can be mounted from current environments
• or files can be copied– GUI wizard to choose appropriate directories and files
– Output will be EGL files and an EGL conversion “project”
Command line conversion utility will run in current build environments
– Utility will require an input file describing conversion:
• Search directories • File names
Output will be EGL files (abc.4gl abc.egl)
IBM Software Group / Information Management
© 2005 IBM Corporation Atlanta, December 2005
4GL modules
(.4gl)
4GLProgram
User Shared
Library (.so)
(Created from.4gl, .esql, .c)
4GL Runtime Library(lib4gsh.so)
4GLForms(.per)
MessageFiles(.msg)
4GL Project
IBM Software Group / Information Management
© 2005 IBM Corporation Atlanta, December 2005
EGLmodules
(.egl)
EGL CUIForms
(.egl)
Message Files(.properties)
EGLProgram
User Shared Library (.so)
(from .esql, .c)JRE
EGL Shared Library
(.jar)
C- Interface Stack Library
Jasper Report(.jrxml)
Jasper Runtime Libraries
EGL Runtime Libraries
EGL Project
IBM Software Group / Information Management
© 2005 IBM Corporation Atlanta, December 2005
Conversion Assumptions
I4GL code is “legal”
– it will compile with I4GL 7.32 compiler
– conversion will not “fix” invalid I4GL code
Multiple passes are required
Functions that can not be resolved during conversion are assumed to be C code functions
– if function is later found to be an I4GL function, re-conversion would be required
C code functions do not use undocumented I4GL internal functions
IBM Software Group / Information Management
© 2005 IBM Corporation Atlanta, December 2005
Conversion Strategy
Goal is to convert an I4GL application to the equivalent EGL application that uses:– the same display device– the same database server– I4GL TUI applications will be converted to EGL TUI applications– Convertion is to be done on a program-by-program basis.
Conversion utility is provided:– as part of the IDE– also available from the command line
Separate conversion passes required for:– database metadata extraction– shared libraries (C code or combination of C and I4GL code)– I4GL source code
Automated conversion should convert most 4GL source code– but, some 4GL programs may require manual intervention
IBM Software Group / Information Management
© 2005 IBM Corporation Atlanta, December 2005
Conversion Process
Conversion Project can take up to 3 steps
– Database Schema Extraction
– I4GL Shared Library Conversion
– I4GL Application Conversion
Conversion should take place in the order listed above
Shared Library may sometime require “reconversion”
IBM Software Group / Information Management
© 2005 IBM Corporation Atlanta, December 2005
Conversion Artifacts
Configuration file– XML file generated from interaction with conversion wizard– contains required conversion project information
Manifest file– XML file generated during conversion of shared libraries– contains declaration and usage information about each of the functions (C and
I4GL) used in the shared library– used to resolve function declarations in dependent I4GL shared libraries– required for subsequent I4GL source code conversions
Log file– contains warnings and errors– status of each source file– summary of conversion
IBM Software Group / Information Management
© 2005 IBM Corporation14 Atlanta, December 2005
Pre-conversion steps
Identify various components of the existing project that needs to be converted.
List all the source files under each component.
Organize your code into proper modules to make the conversion more modular.
Ensure that your I4GL code compiles with the 7.32 compiler.
Make sure that the database server is up and running.
IBM Software Group / Information Management
© 2005 IBM Corporation15 Atlanta, December 2005
Conversion artifacts…
Conversion Configuration
4GL SourceInformix
4GL to EGL Conversion
Utility
EGL Source
EGL build descriptor
EGL Source
Database Schema Source
Manifest file
Conversion log
IBM Software Group / Information Management
© 2005 IBM Corporation16 Atlanta, December 2005
Post Conversion
Needs to be done for each of the conversions.
Verify the log file for Warnings.
Refer the “readme.html” in EGL plug-in directory.
Refer “Readme<Version#>FGL.html” in Conversion Tool plug-in directory.
Refer the converted EGL source for “FIXME” and “TODO”
Open the new projects and fix any validation errors.
Set runtime environment necessary in one of the property files.
Right click on the project, select Properties– Associate a EGL build descriptor for the project– If needed, add JDBC jar files in “Java Build Path”
Select the project in the “Project Explorer”, right click for pop up menu and select “Generate” option
Java source is generated in “JavaSource” directory
Run the application.
IBM Software Group / Information Management
© 2005 IBM Corporation Atlanta, December 2005
Reconversion
Needed only for shared library projects
Application conversion is the only place where all dependencies get resolved.
Manifest file is reconciled
Dependent Shared Library needs to be reconverted
IBM Software Group / Information Management
© 2005 IBM Corporation18 Atlanta, December 2005
Integrating “C” code. At the time of application conversion, the conversion tool creates C code files like
function table map.
These files need to be compiled and linked with the EGL provided objects and shared libraries.
– Application.obj
– stack.dll, stack.lib
– There may be a requirement for using fglsys.h which can be located in EGL installation.
– Other header files may be required like locator.h, decimal.h, datetime.h, ifxtypes.h and int8.h.
Once done, make sure that the shared library is in one of the directories indicated by LD_LIBRARY_PATH and your PATH variable.
Download “Stack Library” and “application object file.”
Use “Native Function Table” generated.
Create new APPLICATION SHARED LIBRARY
Java runtime option to load shared library
“-D vgj.defaultI4GLNativeLibrary=<application shared library name>”
IBM Software Group / Information Management
© 2005 IBM Corporation Atlanta, December 2005
Report Conversion
Report Business Logic gets converted into EGL
Report Presentation Logic gets converted into Jasper Reports
Jasper compilation built into RAD.
Third Party Reports designers can be used to enhance the reports
IBM Software Group / Information Management
© 2005 IBM Corporation20 Atlanta, December 2005
Nature of Jasper Report
JasperReports is a Java Class library.
– Defines specifications for XML based report templates.
– Provides Java utility classes to compile, run and export reports.
Capabilities of Jasper report:
– Pre-defined templates for page layout.
– Can generate reports in multiple formats.• It is also extendable by custom exporter (such as EGL’s Plain Text Exporter)
– Can use external Java code for complex expression processing.
– Generates reports using complete result set.
– Supports Sub-Reports.
IBM Software Group / Information Management
© 2005 IBM Corporation21 Atlanta, December 2005
4GL Report ConversionSeparation of Business logic and Presentation logic
4GL Report
Jasper XML Designs
EGL report handler or
Jasper scriptlet
class
Presentation logic
Business Logic
Communication
IBM Software Group / Information Management
© 2005 IBM Corporation Atlanta, December 2005
Deployment and Runtime
Create a JAR file for deployment.
Use EGL runtime libraries “fda.jar” and “fda6.jar” on target machine for runtime.
Can be found in “redist\EGLRuntimes” of your installation CD.
IBM Software Group / Information Management
© 2005 IBM Corporation Atlanta, December 2005
Demo:
Extract Stores7 Schema
Convert I4GLDemo programs
C-interface example
IBM Software Group / Information Management
© 2005 IBM Corporation Atlanta, December 2005
What Conversion Utility Cannot Do
Cannot fix invalid 4GL code
Cannot convert C libraries
Cannot take the I4GL application to web
IBM Software Group / Information Management
© 2005 IBM Corporation25 Atlanta, December 2005
User Experience - Internal
Converted our Product Tracking System (about 250 files, 70,000 lines of code)
– 175 4GL files– 74 form files– 1 message file.– 8 ESQL/C files– 7 C files
Effort took 4 weeks.
Actual conversion process less than 15 minutes.
Converted EGL (in lines of code was about the same about 85000 lines of code). Most of it were due to comments and leaving the original 4GL code intact (around comments).
The rest of the effort was to test each and every screen, identify certain behavior differences, enter bugs.
Most of the issues entered have already been fixed.
Tested other large scale customer applications in-house and have made it part of our regular “sanity” list.
IBM Software Group / Information Management
© 2005 IBM Corporation26 Atlanta, December 2005
User Experience - External
Large Retailer in Europe
Major Automobile Manufacturer in US
Proof of Concepts in Asia Pacific (Double-byte)
More…
IBM Software Group / Information Management
© 2005 IBM Corporation Atlanta, December 2005
Some Best Practices Using Conversion Utility
Read through the Conversion Utility Users’ Guide & Readme!
Break large I4GL application into logical projects before conversion
Getting comfortable with EGL and the IDE will speed things up
One-time conversion then move on to EGL!
Keep in mind that sometimes modifying the 4GL code may make the re-conversion easier.
IBM Software Group / Information Management
© 2005 IBM Corporation Atlanta, December 2005
In Summary…
IBM Software Group / Information Management
© 2005 IBM Corporation29 Atlanta, December 2005
main.4gl
BL
inventory.4gl
BL
catalog.4gl
BL
BL
IDSText
Reports
c_code.so
C functions
main.egl
BL
inventory.egl
BL
catalog.egl
BL
BLSchemaLib.egl
c_code.so
C functionsText
Reports
I4GL to EGL Conversion
Typical I4GL Program … Becomes Typical EGL Program
form.per
form.egl
IBM Software Group / Information Management
© 2005 IBM Corporation30 Atlanta, December 2005
IDSDB2
main.egl
BL
inventory.egl
BL
catalog.egl
BL
BL
SchemaLib.egl c_code.so
C functions
Text
Reports
PDF Output
HTML Output
XML Output
Webmain.egl
Webinventory.egl
Use your I4GL Business
Logic in EGL Web Services
Use your I4GL Business Logic with Message Queues
Use your I4GL Business Logic
in whatever comes next!!!
Now What Can You Do With It …
IBM Software Group / Information Management
© 2005 IBM Corporation32 Atlanta, December 2005
4GL/EGL Redbook
Free to download via ibm.com (Search for 4GL to EGL RedBook)
printed copy orderable via amazon.com
EGL Language Concepts
The Rational SDP environment
A simple EGL web application
4GL to EGL conversion
EGL and databases
Advanced EGL web rogramming
EGL and JasperReports
EGL Deployment (standalone and web)
EGL CUI applications
plus much more...
IBM Software Group / Information Management
© 2005 IBM Corporation33 Atlanta, December 2005
EGL Zone on IBM DeveloperWorks
EGL Tutorials
EGL Documentation
EGL Code Examples
An active EGL Forum
plus more...
http://www.ibm.com/developerworks/rational/products/egl/
IBM Software Group / Information Management
© 2005 IBM Corporation Atlanta, December 2005
Reference Conversion Utility User guide :
– ftp://www6.software.ibm.com/software/developer/library/rational/pdf/4gl_to_egl_conversion_user_guide.pdf
Conversion Utility README file : <RAD_HOME>/egl/eclipse/plugins/com.ibm.etools.i4gl.conversion_<version>/readme.html
Configuration file and DTD examples : <RAD_HOME>/egl/eclipse/plugins/com.ibm.etools.i4gl.conversion_<version>/etc/
Stack Library download site : February 2, 2005http://www3.software.ibm.com/ibmdl/pub/software/rationalsdp/rad/60/redist/
EGL Help content : Use RAD menu, Help->Help Contents for EGL documentation
EGL Zone on developerWorks (with Tutorials and downloads) : http://www-128.ibm.com/developerworks/rational/products/egl/
Jasper Reports: http://jasperreports.sourceforge.net/
http://www.jasperassistant.com/
IBM Software Group / Information Management
© 2005 IBM Corporation Atlanta, December 2005
Upcoming Learning Events about RAD & EGL
IDUG 2006 NA Conference
– May 2006, Tempa, FL, www.iiug.org
InfoBahn Events Worldwide
– Refer to www.iiug.org for schedule detail Chat with Lab throughout the year
– Check with Anita McKeithen ([email protected]) for final schedule
Converting Your Informix Converting Your Informix 4GL Application to EGL4GL Application to EGL
Jin ZhangJin [email protected]@us.ibm.com
Informix User Forum 2005 Moving Forward With Informix
Atlanta, Georgia December 8-9, 2005