× 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.



Well, it's been a long day of responses, but I'm on a deadline, so I 've 
held off until early evening.

I'm happy to see interest in some sort of "business programming" benchmark 
or example, but I have a few cautions. First is myself. I will freely 
admit that I have not written a business application since 1982, and I 
claim no serious recent expertise in the area of business programming. 
I've spent most of my career designing and developing commercial DBMS, IT, 
and developer tools and utilities. So I think that I might make a good 
impartial observer, but that's it.

Joe, you describe 3 categories of programs that you think are typical of 
business programming: master-file maintenance, management information 
inquiries, and transaction processing. I can buy that TP pretty much is 
typical business app meat and potatoes work, but what is it about the 
first two that make them specific to business? Lots of applications have 
large master files. Nonbusiness examples might be the human genome 
database or the processing done at Fermilab or CERN where physicists 
search huge petabyte databases of sub-atomic events for observations with 
a specific decay signature or particle dispersion geometry. Many many 
nonbusiness applications work with data warehouse style information 
analysis, including the two I just mentioned. This work is done, of 
course, in lots of different languages, but recently a lot of it is 
scripted stuff like Python, PERL, etc., except for where there are 
real-time execution constraints. Now I'm not trying to say that master 
file maintenance and information analysis are NOT business processes, but 
I'm just trying to show that they are common to many kinds of 
applications, and are done easily in many languages.

This brings me to my second point of concern about an example suite: What 
does good mean? When someone says Java sucks at business processing, or 
RPG isn't productive, what do we mean? What are the metrics for whether or 
not language X is good or bad at a particular kind of application?

Now I've got one other question for you Joe, slightly off, but not quite, 
of the previous topic. You gave us this very tight piece of RPG code for 
currency conversion:

  Convrate = 1.0;
  Setgt (fromcountry : tocountry) ConvMast; 
  Readpe (fromcountry : tocountry) ConvMast;
  If %found(ConvMast);
    ConvRate = CMCONVRATE;
  Endif;
  Return Convrate;

Paul Holm gave us the corresponding SQL statement and evaluation logic:

SELECT cxcrr FROM jdeprddta.f0015 WHERE cxcrcd = ? AND
cxcrdc = ? AND cxeft=(SELECT MAX(cxeft) FROM jdeprddta.f0015)

RowCollection rc = DataEngine.getRows(context);
if (rc.size() > 1) {
         throw new CMException("CurrencyManager.getExchangeMultiplier() - 
retrieved multiple results");
}
if (rc == null || rc.isEmpty()) {
        return new BigDecimal("1.00");
}
return new BigDecimal("" + rc.getValueAsDouble(0, 0));

Now as far as I can see, the above is Paul's code for currency conversion 
when you strip comments and JDBC housekeeping. We all know the 
housekeeping doesn't have to be there (it can be in a standard utility 
method), but was put there because Joe asked to see everything that you 
had to do to calculate the conversion. Now it seems to me that Paul's 
logic isn't that much bigger than Joe's. What I don't understand about 
Joe's code, and I know very little about RPG, is why, if Paul has to 
perform a SELECT MAX(cxeft)... subquery as part of the SQL condition, why 
doesn't RPG code have to do something similar? How does RPG find a maximum 
value WITHOUT a scan of the file or else having an index? Also, where is 
the error handling in Joe's code for the multiple result condition? Is 
this somehow handled automatically by RPG? Is there some file set-up that 
is done elsewhere? How does RPG know what these fields are? Don't 
ConvMast, fromcountry, and tocountry have to be defined somewhere as to 
their physical or logical file and field mapping?

Also, Paul, if you have the background for this, what would this method 
look like if it were to be done using an OO to relational mapping library 
like Hibernate?

Since this is a Java discussion list, rather than a RPG one, I don't feel 
too out of place asking what this RPG code does. What needs to happen here 
is that a basic process like currency conversion needs to be described as 
pseudocode, a use-case, etc. and then all of the relevant code needs to be 
placed side by side.

And then there is still one other point that I don't quite understand 
about this debate (but I love this debate!): Both Java and RPG can handle 
procedural logic, but both have non-procedural capabilities in different 
areas. Just because one codes a procedural method in Java, does that make 
it lose to RPG? Just because an abstract base class can be created in 
Java, containing common methods, does that make RPG lose? Can't you have 
common libraries in RPG that contain reusable modules? I believe someone 
was describing a rather elegant use of RPG templates earlier today.

That's all for now. I'll check back later.
_________________________________________________________________
Jeff Furgal

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.