× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thanks Henrik - appreciate your thoughtful response.

Am trying to use more and more of these tools for new development and when
adding function to old stuff. Will have to keep up the good fight.

Jim


----------------------------------------------------------------------

message: 1
date: Sun, 19 Feb 2012 16:19:32 +0100
from: Henrik R?tzou <hr@xxxxxxxxxxxx>
subject: Re: Is RPG dying (Henrik R?tzou)


Jim



There are no 100 words solutionL, there is however a lot of promises and
immediate Quick Fixes products that may remove your headache for a year or
two without solving the basic problem that is that we have a lot of
different devices connected to us via the internet and those we have to
serve in the future.



On the server side I don?t see any reason to learn old RPG dog?s new tricks
in regards to changing/leaning a new programming language. RPG runs under
ILE and ILE means that RPG can call OO modules written in other languages
if it is necessary. To me it would be a total waste of time. However many
old dog?s should maybe upgrade their skills in RPG if they hadn?t done it
into areas such as /free, SQL, service programs and procedures etc.



The catch here is that by doing so

a. It is fairly close to their comfort zone

b. It is less time consuming that learning a new program language

c. If they change program language, they have to learn /free format
programming and SQL anyway

d. The new methods can be implemented ?as you go? and even within existing
code it only requires determination to do it ? and occasionally a little
help which there are plenty of on the net.



Changing from 5250 UI to another UI is the big challenge especially if the
task is to create a new UI independent system. Unfortunately modernization
very often ends up in just another UI dependent system with monolithic
programs. Many people think that monolithic is a 5250 phenomenon but it
isn?t, most PHP, ASP.NET <http://asp.net/>, IBM I UI modernization products
is as monolithic
as an old 5250 program that has Model, View and Controller (MVC) as an
entity .



The only way to establish a UI independent system is to create a system
based on a Service Oriented Architecture (SOA) and that is I?m afraid bad
news because it is a boring process and even worse ? you don?t get any
applause because you have moved a piece of BL from your 5250 program into a
procedure in service program but you risk a lot of criticism if it doesn?t
work.



However it isn?t a revolution because many of us actually are programming
in a SOA without knowing it and has been doing it for years. To give an
example on a SOA in practice it is just to have moved a commonly used price
calculation routine into a dynamical called program or as a procedure in a
service program. The price calculation program/procedure becomes a common
service/resource untied and unaware of who uses it (5250 or a batch
program) ? so simple are a SOA even if it sounds complicated!



Somebody will probably attack me and say that this is not SOA because a SOA
requires a common independent messaging system between requester and the
service. I will say that they are lunatics because if messaging by
parameter lists between millions of ILE programs living under
QSYS.LIB/native environment isn?t common, what is then, XML if you want
JSON?



While the protocol between ILE programs are the parameter list, the
protocol in internet based communication may vary. But a key component is
the HTTP layer. In the higher layer is a request made by the HTTP GET
(URI?s) or POST (FORMS) that then result in a JSON or XML message is what I
call device independent messages.



The trick is to remove all the clever ?technology strategy noise? because
there isn?t hardly any difference in asking for a price calculation service
in a RPG program, in an OS command or from the net:



RPG Dynamic call

getitmprc(custno:itemno:itemprice);



RPG Serviceprogram/Procedure call

itemprice = getitmprc(custno:itemno);



CL command call

GETITMPRC CUSTNO(&CUSTNO) ITEMNO(&CUSTNO) ITEMPRICE(&ITEMPRICE)



HTTP call with JSON response

http://www.myserver.com/cgidir/getitmprc.pgm?custno=1234&itemno=5678

{

success : true

,itemprice: 125.00

}



And externalize/publish your internal SOA service GETITMPRC can actually be
done in a few statements:

custno = pExtgetVar(?custno?);

itemno = pExtgetVar(?itemno?);

itemprice = getitmprc(custno:itemno); // your existing internal SOA
function

jsonNode(?*object?);

jsonNode(?*boolean?:?success?:?true?);

jsonNode(?*string?:?itemprice?:%editc(itemprice:?9?));

jsonEndNode();

echoToClient();



******* YOU ARE NOW LEAVING YOUR RPG COMFORT ZONE AND THE SERVER
************

and the client side may be as simple as this (OO javascript) ?

getitmprc(custno,itemno);

if (jsonData.success == false) {

Ext.MessageBox.alert('ERROR', '' +
jsonData.message);

return;

}

if (jsonData.success == true) {

document.getElementById(itemprice).value =
jsonData.itemprice;

return;

}



The principle of KISS (Keep it simple Stupid) still works, but in 100 words
you only get a fairytale :-)

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.