EGL and i

Previous Next
2

Okay, with expert guidance from Chris, I managed to engineer a Java-free RUI application architecture. It's not exactly simple. In test mode, any REST request goes through an invisible proxy in the workbench. The request that your service sees is not what the proxy sees; the EGL JavaScript runtime actual wraps your request inside a larger request which is sent to the proxy. The proxy unbundles that and sends it to the target service. The proxy then takes the response, rebundles it and sends it back to the runtime.

So, if you're writing your own RPG version of the proxy, then you have to do all that bundling and unbundling. Then you have to invoke the target service. I, however, skipped that. Since I have control over all the pieces, I extracted the actual business logic and re-wrote the target service to call the business logic. Then I added code in the proxy to call the business logic directly.

It's not quite as complicated as it sounds and it works really well as a proof of concept. I can now say with certainty that it is entirely feasible to write a complete, Java-free EGL Rich UI application, using only RPG as the back end.

I'll clean up the code and export the project (including a savefile with the RPG code) in the next day or two.



Sep 10, 2009 2:59 PM Click to view ChrisLaffra's profile ChrisLaffra

I have had quite a few discussions with people now on why EGL Rich UI needs an Ajax proxy. Please consult this blog entry for an explanation of what the proxy does exactly and why it is there: http://www-949.ibm.com/software/rational/cafe/blogs/egl-rich-web/2009/09/10/web-security-and-why-egl-rich-ui-needs-an-ajax-proxy

Sep 10, 2009 5:02 PM Click to view JoePluta's profile JoePluta in response to: ChrisLaffra

I absolutely understand why the Ajax proxy is there and what benefits it provides, Chris. It's a powerful concept and it avoids some of the rather kludgy workarounds in the Web 2.0 world (such as the IMG source magic for GoogleApis).

At the same time, I did want to make sure that I could honestly tell someone that an EGL Rich UI architecture can be created using only EGL Rich UI and RPG, with no Java whatsoever. I certainly don't recommend it; my services are so thin that they add very little overhead and so running a Web application server (WebSphere or Tomcat) is not a problem. But it's important to be able to counter any claim that EGL requires WebSphere or Tomcat. And with your help, I've done that.

And when I post my project, everyone will have an example of a proxy written in RPG.

Bottom Banner