12

Our company uses an IBM iSeries for a majority of our data processing. All of our internal apps are written in RPG. According to IBM's roadmap, IBM is pushing companies to move to Java/J2EE. We're looking to modernize our internal apps to a more GUI interface. We provide an external web presence by using Asp.Net webs, although perhaps greenfield projects could be Java. One option is to use a screen scraper app while staying on RPG but I think it may be better to slowly go the way of IBM's roadmap and move to Java. Our goal is to migrate to a GUI interface and to be inline with IBM's roadmap.

Have you been involved with an RPG to Java migration, even if only greenfield projects were Java and the brownfield projects remained RPG?

My management is afraid that:

1) updating JRE on workstations, particularly thin clients, could cause an administrative nightmare (Our company uses 80% thin clients and 20% PCs) and

2) Java demands too much overhead of the workstation to run effectively

3) Incompatibility between JRE clients as we update, potentially breaking other apps requiring the JRE.

Can you shed some light on this? Are there any huge benefits? Any huge gotchas?

CLARIFICATION: I am only interested in a migration to Java. What is the difficulty level and do I lose anything when going from RPG to Java? Are the screens very responsive when migrated to Java?

Bill Martin
  • 4,825
  • 9
  • 52
  • 86
  • 1
    As I said in my comment under JamesA's answer, the performance is highly dependent on your platform. How old is your iSeries? – John Y Nov 21 '11 at 23:26
  • 1 year old. Just upgraded. Don't know the specs though. – Bill Martin Nov 22 '11 at 01:27
  • You may need additional RAM then to achieve better performance. You won't know for sure until you start using it. – Mike Wills Nov 22 '11 at 14:48
  • 3
    @BillMartin - "According to IBM's roadmap, IBM is pushing companies to move to Java/J2EE" - Where may I find that roadmap, please? – Dennis Aug 02 '12 at 12:24

4 Answers4

13

My company is also attempting to migrate to Java from RPG.

  1. We're not attempting to use a JRE on a thin-client, we're moving to web applications delivered through a browser. This may entail (eventually) replacing our old POS-scanners with some of the newer PC-based ones.
  2. I have been informed (by company architects) that the JVM on the iSeries OS does have some performance issues. I do not personally know what these limitations are. In our case the migration has involved allocating an AIX resource, which is supposed to be much better - talk to your IBM rep about whether you just need to purchase the OS license (I just program on the thing, I don't get involved in hardware).
  3. See reponse to question 1. In a larger context, where you're trying to update the browser (or any other resource), this is usually handled by having enterprise licenses - most will have options to allow forced, remote updates.

Some other notes:

  • You should be able to move to just using .NET, although you may need different hardware/partitions to run the environment. You can talk to DB2 that way, at least. The only benefit Java has there is that it will run on the same OS/hardware as the database.
  • I've seen a screenscraper application here (it was in VB.NET, but I'm fairly sure the example applies). Screen-scraping was accomplished by getting/putting characters to specific positions on the screens (the equivalent of substring()). That could be just the API we were using - I think I've heard of solutions that were able to read the field names. However, it also relied on the RPG program flow for it's logic, and was otherwise not maintainable.
  • Most of the RPG programs I've seen and written tend to be a violation of MVC, meaning you can't do anything less than integration testing - the history and architecture of the language itself (and some developers) prefers that everything (file access to screen display) be in one file. This will also make attempting to wrap RPG for calling remotely effectively impossible. IF you've properly seperated everything into Service Programs, you should be able to wrap them up (as the equivalent of a native method call, almost) neatly - unfortunately I haven't seen anything here that didn't tend to rely on one or more tricks that wouldn't hold up for typical Web use (for example, using a file in QTEMP for controlling program execution - the session on the iSeries effectively disappears every time a new page is requested...).
  • Java as a language tends to promote better seperation of code (note that it can be misused just as badly), as it doesn't have quite the history of RPG. In general, it may be helpful to think of Java as a language where everything is a service program, where all parameters are passed with VALUE set, OPTIONS(*nopass : *omit) is disallowed, CONST is generally recommended, and most parameters are of type DS (datastructure - this is a distinct type in RPG) and passed around by pointer. Module level parameters are frowned upon, if favor of encapsulating everything either in passed datastructures or the service program procedures themselves. STATIC has somewhat different use in Java, making variable global, and is not available inside of procedures.
  • RPG is quite a bit more simple than Java, generally, and OO-programming is quite a different paradigm. Here are some things that are likely to trip up developers migrating to Java:
    1. Arrays in RPG start at 1. Arrays in Java start at 0.
    2. Java doesn't have 'ouput' parameters, and all primitive types are passed by value (copied). This means that editing an integer won't be visible in calling methods.
    3. Java doesn't have packed/signed encoding, and so translating to/from numbers/strings is more involved. The Date type in Java also has some serious problems (it includes time, sort of), and is far more difficult to meaningfully change to/from a character representation.
    4. It's harder to read/write files in Java, even when using SQL (and forget about using native I/O directly with Java) - this can be mitigated somewhat with a good framework, however.
    5. There are no ENDxx operators in Java, everything uses brackets ({}) to specify the start/end of blocks.
    6. Everything in Java is in freeformat, and there are no columnar specifications of any sort (although procedure signatures are still required). There is no hardlimit on line length, although ~80 characters is still recommended. The tools (the free ones, even) are better, period, and generally far more helpful (although they may take some getting used to for those exposed to SEU). There are also huge, free libraries available for download.
    7. The = sign is not context-sensitive in Java the way it is in RPG, it is always used for assignments. Use the double-equals, == operator for comparisons of values in Java.
    8. Objects (datastructures) cannot be meaningfully compared with == - you will often need to implement a method called equals() instead.
    9. Strings are not mutable, they cannot be changed. All operations performed on strings (either on the class/datastructure itself, or from external libraries) return brand new references. And yes, strings are considered datastructures, not value types, so you can't compare them with == either.
    10. There are no built-in equivalents to the /copy pre-compiler directives. Attempting to implement them is using Java incorrectly. Because these are usually used to deal with 'boilerplate' code (variable definitions or common code), it's better to deal with this in the architecure. Variable(ALL D-specs, actually) definitons will be handled with import or import static statements, while common-code variants are usually handled by a framework, or defining a new class.

I'm sure there are a number of other things out there, let me know if you have any other questions.

Clockwork-Muse
  • 12,806
  • 6
  • 31
  • 45
  • 1
    Keep Java programs on the AS/400 in their own memory pool to get good performance. Having to share with zillions of short lived RPG programs will cause JVM swapping. – Thorbjørn Ravn Andersen Nov 25 '11 at 09:37
3

Distributing and managing a fat client would be an absolute nightmare.

The ideal solution is a Java based web application hosted on the iSeries. The workstations access your applications through a web browser just like ASP.NET.

I've been using the Grails Framework to modernize and create new applications and it is working wonderfully.

James Allman
  • 40,573
  • 11
  • 57
  • 70
  • How 'intimate' can you get with these apps on the iseries? Can you do business logic similar to what is available in RPG? All I've been able to do with ASP.Net is normal SQL commands. Are the dev times comparable between RPG and web screens? Are the response times quick? We do a lot of data entry and need fast response. – Bill Martin Nov 21 '11 at 22:27
  • @BillMartin You can put all of your business logic in a Service layer or call RPG programs to perform the business logic. Dev times are relative to experience so that's a hard question to answer. Java on the iSeries is extremely fast. Browser interfaces with the proper application of asynchronous javascript (Ajax) can be as fast or even faster than green screen interfaces. – James Allman Nov 21 '11 at 22:58
  • How fast Java is depends greatly on which hardware and which JVM are used. It should be reasonably fast on newer machines. It was dog slow on old machines. Also, I think it's a stretch to say any browser interface is even faster than a green screen interface. On modern server hardware, with modern client hardware, the browser interface can be plenty fast enough. – John Y Nov 21 '11 at 23:17
  • @JohnY It's entirely dependent on the design of the user interface. Proper implementation of Ajax can make the GUI pop. For example performing real-time validation as opposed to the 'key it all in, submit, fix the errors, submit, repeat' cycle is a huge user time saver. Performing ajax form submission instead of POST/redraw can make bulk data entry really fly. Cloning a green screen without taking advantage of the new medium is going to be lackluster at best. – James Allman Nov 21 '11 at 23:35
  • @JamesA: Ah, I completely agree that green screens limit the UI design, and that they tend to be clunky from a workflow point of view. When I saw the word "fast" I immediately thought only of pure latency between the server and the client. Yes, the point of Ajax is to make the client do more so there needs to be less data passed between client and server, but at some point, data *does* need to be passed, and during those times, I don't see how it could feel faster than a green screen. Also, on severely underpowered clients, the browser itself can feel sluggish. – John Y Nov 22 '11 at 00:11
  • @JohnY, the new JVM's (non-classic ones) perform much better, especially in the own memory pool. – Thorbjørn Ravn Andersen Nov 25 '11 at 09:38
2

When IBM says you should move to Java/J2EE then you should probably move your applications to web applications like your asp.net web apps. You should probably use a feature rich interface like JSF or GWT.

Web applications don't have to worry about JRE problems as you just need a standard browser.

However I don't know RPG and I don't know the suggested migration strategy.

Udo Held
  • 12,314
  • 11
  • 67
  • 93
  • I don't believe the question asked for alternatives. Also, since when was there such a thing as a "standard" browser? – Chris Browne Nov 21 '11 at 21:34
  • 2
    I believe, when they say move to J2EE then its all about web applications. Oracle suggests the same for their old Oracle Forms applications. – Udo Held Nov 21 '11 at 21:36
  • 2
    @Chris I got an addition: Do you really think that IBM would suggest switching to desktop applications where they don't earn anything, because the basic JRE is free? They have got a hugh web application stack around WebSphere. An appserver, an ESB, MQ and lots of other J2EE based technologies. – Udo Held Nov 21 '11 at 22:21
  • 2
    @Chris: The point of this site is to help people. If someone feels that using a different alternative is the best solution for the person asking the question, why shouldn't they express that? Especially since the question here isn't very specific in the first place. It seems like it's just asking for thoughts and experiences. (It's actually flirting with not meeting the guidelines for Stack Overflow questions.) And now there is even another answer along similar lines as this one. So are all of us (other than you) misreading the question? – John Y Nov 21 '11 at 22:41
0

I am a developer involved in as400 modernization. So far, from my experiences, I can give you my insights.

In addition to Java EE based websites, you can probably go for jax-ws based web services, which provide services for different flat and grid screens.

The clients can consume them in whichever technology they desire. Some lag is there, but the overall usability is good as in the normal web based applications.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
Sumit Bisht
  • 1,507
  • 1
  • 16
  • 31