It's because I think that the i5/iSeries is the best platform for running business logic and RPG is the best language for writing it. But what about browser-based interfaces? Isn't RPG limited to those 24x80 green screens?
Not at all. Without knowing the first thing about Java, you can still write RPG-CGI programs that provide a Web interface to your programs. And then, as you begin to pick up Java knowledge, you can gracefully move to servlets and JavaServer Pages. The ultimate design for browser-based applications, in my mind, is message-based business logic servers written in RPG, which communicate with servlets and JSPs for the UI. Do you really need servlets? Can't you just use JSPs?
Technically, yes, but that's the old architecture which we call Model I JSP design. The "new" style, which we unimaginatively call Model II JSP, is much more like the sort of programming we're used to: fill a buffer, display a panel, let the user enter data, process the data. The only difference is that we use a JSP instead of a display file, and a servlet instead of an RPG program. So does that mean rewriting everything in Java?
Absolutely not. In fact, that's the last thing you should think about doing. While some businesses may find it makes business sense to eventually move to a pure Java solution, it's clearly not the right answer for everyone. What if pure Java makes business sense? Should businesses just convert their RPG to Java?
If pure Java is the ultimate endpoint, you should go there in stages: rewrite your user interface, separate your application flow from your business logic, encapsulate your database in servers, rewrite your application controllers, and finally rewrite your database servers. This is a multi-stage process that, properly managed, can be done without disrupting your business. What about Web services?
Web services are a great concept, even though the implementation is still a little quirky. And while currently it's easiest to write the Web services communications using Java, that doesn't mean you can't call an RPG program to read the data on one end of the Web service and process it on the other. So, you're really anti-Java then. Right?
Not at all. My company has not one but two commercially successful Java-based products: CPYSPLFPDF and PSC/400. Java is a great tool for certain things -- user interfaces are one example. It's just like my stance on SQL: I love SQL when used correctly, and I get frustrated when smart people insist on using it where it doesn't belong. How can you tell when SQL belongs or doesn't?
Well, common sense can help. If you're processing sets of records at one time and doing the same thing to all of them, or if you're trying to read, sort and summarize data from a file with ad hoc filtering and ordering, then SQL is definitely the correct choice. For single record access (the traditional CHAIN operation in RPG), native I/O far outperforms SQL. For more information including benchmark results, go to the iSeries Application Architecture Initiative Web site. If you want to write applications that use RPG and JSPs together, how do you get started?
Well, participating in labs and presentations such as the ones provided at DevCon or COMMON conferences can provide that sort of information. Check out one of my labs, or labs by any of the other great conference presenters, from Don Denoncourt to Jon Paris to Jim Mason. They cover topics ranging from advanced Web Services to advanced RPG techniques to WebFacing. And no matter which approach is best suited for your business, you'll find someone to explain it. What are your recommendations for people just starting out in the world of Web application development?
I suggest learning WDSC and seeing all the great things it can do. From creating Web sites to writing RPG programs, WDSC does it all, and it allows you to test your browser-based applications right on your desktop.