Practical RPG: New Open-Source EGL Tools for RPG Developers

RPG
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

How quickly can you build multi-tiered Rich Internet Applications? With the new open-source EGL Development Tools, you can measure your development time in hours, not days or weeks.

 

I have been an advocate of EGL for a long time now. I started writing about it almost seven years ago, although at first I wasn't exactly enamored with the language. However, as EGL progressed over the years, I've come to see the power of a true 4GL. Yes, anything I can do in EGL someone else can do in Perl or PHP or Python. But I guarantee that unless you're just bolting together pre-existing bits, I can do it a lot faster in EGL.

What's Wrong With Pre-Existing Bits?

Nothing! Nothing at all! Pre-existing bits are very important, especially for things like mail systems and database queries and other commodity functions. Prefabricated software components exist that ably fill entire software niches, such as Contact Management Systems (CMSs). Seriously, do you want to write an appointment-scheduling application? I don't! So don't think that I don't appreciate a good chunk of off-the-shelf software; I only have so many hours to be productively writing software, and I don't want to waste it developing YATMA (Yet Another Text Messaging App) that notifies me when a serious message appears on the QSYSOPR message queue.

 

But I don't necessarily have to become an expert at Python to install a Python application or even to modify it. If I pick a piece of prefab software, it's both because the package is easy to install and implement and because what modifications I do need to make are simple and have a large community to help me make them. In fact, if you want to see just such a package, go to the Plone home page. Plone is a powerful and hugely popular CMS system written in Python with an extensive support community. I think Plone has more user groups than the IBM i.

Okay, Then Where Should I Focus My Time?

Or perhaps the question is, "What will make me most productive as an RPG programmer?" See, I don't want to become a Python programmer, or a .NET programmer, or even a Java programmer. What I want to be is an RPG programmer with m4d w3b sk1llz (that's "mad web skills" to you non-l33t types out there). I want to be able to create powerful next-generation Web-based applications using a tool that doesn't just co-exist with my RPG abilities but instead is symbiotic: my Web language and my RPG language together should be better than both separately. And that's where EGL really shines. Everything, and I do mean everything, about EGL is businesslike. By that I mean that every concept in EGL is familiar to an RPG programmer, and where the two differ, EGL is usually better.

 

As an example, in RPG, I group related fields in a data structure. If it's a data structure that I pass between programs, I usually make it an externally described data structure, which essentially means that I use a record format as my data structure. In EGL, I group data in a record, and I can pass that record from one program to another, even if the programs are running on different platforms in different languages.

 

"Wait," I hear you say, "how can it be in different languages? It's EGL!" Yes, as the programmer, you write the code for the different tiers in EGL, but the EGL that you write is then deployed in different languages, depending on the tier. The client side that runs in the browser is deployed in JavaScript; the server side is deployed in Java. You don't care; you write EGL, and the generator takes care of all that for you. Well, except for the RPG side, where EGL automatically converts your record into a data structure before calling your RPG program. Nice, eh?

 

Here's another small example: guess what the index of the first element of an array is in EGL? If you guessed zero, you get fifty lashes with a PHP noodle, because in EGL, as in RPG, the first element of an array is index one (1).

 

Yet another thing that makes EGL an excellent application language is its tightly integrated SQL support. EGL provides tools to create records from existing SQL tables. Once the records are created you can use EGL opcodes like get and add to access your database nearly as easily as you can use CHAIN and WRITE in an RPG program. It's definitely easier than trying to use the ODBC wrappers provided by languages like Java and PHP.  And with the new open-source version, it's remarkably easy to access databases on two different machines simultaneously.

What's That About Open Source?

This is the point of this article and is the fact that should really get you going. Let's say you want to extend your skills to the Web. You're convinced that Java is too foreign of a world, so you're going to use PHP because it's available on the IBM i for "free." Well, it's free as long as you don't count the time you'll spend learning PHP. But yes, the tools are free, and until recently, that gave PHP a huge advantage over EGL (a seat of the commercial IBM tooling for EGL, Rational Business Developer, will cost an IBM i shop about $1,200). But with the announcement of the open-source EGL Development Tools, the price issue goes away. You can download the tools today and start learning EGL. The most recent release (version 0.8.0 M3) contains the full support for calling RPG programs from EGL, so you can begin building multi-tiered rich Internet applications today.

 

So now, instead of having to learn the rather arcane Java-like syntax of PHP, with its zero-based arrays and JDBC-like SQL wrappers, you can instead use EGL to quickly write rich applications that can use SQL when it fits and call RPG when you need real power.

I Like Symbiosis

I do. I like symbiosis. I like it when my skills feed off one another. Rather than learning a completely new mindset such as OO programming, I can write procedural code in EGL. I remember long ago talking with Jon Paris about how Java would be a wonderful language if only there were a more procedural variant. EGL is as close to procedural Java as you're going to get. In fact, with a little work you can even create constructs that act very much like objects in OOP languages, although I've rarely needed to do anything that complex. Instead, my long years of experience in writing procedural code are directly applicable to writing EGL.

 

So, go out, get the open-source version of EGL, and give it a try. I think you'll be pleasantly surprised by how quickly you can become a Web application wizard.

 

Joe Pluta

Joe Pluta is the founder and chief architect of Pluta Brothers Design, Inc. He has been extending the IBM midrange since the days of the IBM System/3. Joe uses WebSphere extensively, especially as the base for PSC/400, the only product that can move your legacy systems to the Web using simple green-screen commands. He has written several books, including Developing Web 2.0 Applications with EGL for IBM i, E-Deployment: The Fastest Path to the Web, Eclipse: Step by Step, and WDSC: Step by Step. Joe performs onsite mentoring and speaks at user groups around the country. You can reach him at This email address is being protected from spambots. You need JavaScript enabled to view it..


MC Press books written by Joe Pluta available now on the MC Press Bookstore.

Developing Web 2.0 Applications with EGL for IBM i Developing Web 2.0 Applications with EGL for IBM i
Joe Pluta introduces you to EGL Rich UI and IBM’s Rational Developer for the IBM i platform.
List Price $39.95

Now On Sale

WDSC: Step by Step WDSC: Step by Step
Discover incredibly powerful WDSC with this easy-to-understand yet thorough introduction.
List Price $74.95

Now On Sale

Eclipse: Step by Step Eclipse: Step by Step
Quickly get up to speed and productivity using Eclipse.
List Price $59.00

Now On Sale

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: