Modular ILE Key Stop on Road to Java
[Editor’s Note: This article is part two of a three-part series on making the transition from RPG to Java in an AS/400 shop. The first part of the series ran in the Dec. 18, 1998 issue of MIDRANGE Systems and covered migrating from RPG III and CL to RPG IV and ILE CL.]
So you’ve upgraded your AS/400 application development from RPG III and CL to RPG IV and ILE CL, with an eye towards a Java future. Now it’s time to start taking advantage of the benefits of modular programming that your new application development environment offers.
What is modular programming? Put simply, it’s the ability to compile several lines of code into one module. Modules are then bound into objects, which are linked to one another. ILE languages, including RPG IV and ILE CL, support this type of programming.
“Modularity is not a new concept in the software engineering industry,” says Jing Wang, senior software engineer at IBM’s Rochester, Minn. AS/400 development center. “It makes your applications easy to maintain and easy to upgrade.”
With ILE compilers, code can be organized into smaller modules without paying a performance penalty, Wang explains. “Before ILE, the only option was to put program A and B together with no binding and no link editing. Editing the source file that way is not easy. You can’t read more than a couple pages at a time and you often have programming errors caused by the size of the source file. If you change one line, you can compromise 10,000 lines of code,” Wang says.
“With modular programming, you break 10,000 lines of code into smaller chunks, say of 1,000 or 500 lines without paying a performance price.”
Because modules can be called several times in the same program, maintenance is easier since changes only need to be made once. Java, with its reusable components, works in a similar fashion.
“The way the industry is growing towards Java and the OO world, developers are facing that paradigm,” Wang says. “Software is being built using small building blocks that are reusable. If you’re not doing ILE, you’re not able to develop applications like this.”
Wang says RPG programmers have typically resisted this type of programming because of the performance penalty between program calls. But ILE languages have overcome that.
“Moving from RPG III to RPG IV gets them into modular software engineering. They can start to think about programming in terms of building blocks. They’re used to having everything under one umbrella, now their applications will share code between modules. It’s the foundation of object-oriented programming and Java.”
Wang says using modular ILE programming will make the eventual transition to Java smoother, overcoming some of the difficulties RPG programmers had in moving to C++.
“When C++ first came out, RPG programmers found it a difficult-to-grasp concept. They were so used to the application is the program mentality that it was hard for them to understand the concepts of libraries and function calls in C++.
“[Modular ILE] gives them a kind of middle step, where they can extend the RPG language to a new software engineering paradigm.”
“Java is a distributed object environment,” says John Quarantello, IBM AS/400 Brand Java marketing manager. “The only thing close to it [on the AS/400] is ILE RPG and COBOL. It’s a good way for people to get started in Java.”
And even AS/400 shops with no intention of moving to Java can benefit from the shift to modular ILE programming. Performance gains can be made, programmers’ workloads can be eased and job resources can be more easily controlled.
“Performance is one advantage and when you look at it long-term, whenever you enhance a piece of code or fix a problem in the code, it just makes it a lot easier,” Wang says.
[In the third and final installment of the Road to Java series in the Feb. 8 MIDRANGE Systems, we will look at using Modular ILE to take advantage of advanced DB2/400 features and augmenting your ILE application development with a GUI, JavaBeans and ILE service programs.]