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



> From: furgalj@xxxxxxxxxxxxxxxx
> 
> 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.

I agree.  Not trying to say otherwise.  I'm just separating them from
TP.


> 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?

That's for us to decide.


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

Actually, no, all of Paul's code was necessary because he's using
connection pooling and prepared statements.  Because of that, you
basically have to go through all of the motions he's gone through for
every statement.

No, Jeff, Paul's logic is much larger than mine.


> 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?

I have an index, by fromcountry, tocountry and effective date.  That's
the same index Paul would need for his basic SELECT (but NOT the
additional index he would need fopr his MAX).  By using SETGT and READPE
on the logical view, I manage to avoid the need for MAX.  This is one of
the advantages of native I/O.


> Also, where is
> the error handling in Joe's code for the multiple result condition?

I ignored this.  This is a database error.  If we were to code for every
single database error, our code would be gigantic.  That means on EVERY
fetch for a master record you need to check the row count.

On the other hand, if I thought my application programmers were liable
to put in duplicate records, I could put a UNIQUE constraint on the
logical file, at the cost of the overhead.  Tradeoffs.  Personally, my
solution would be to purge not only the file but also the programmer who
wrote duplicate records to the file.


> Don't
> ConvMast, fromcountry, and tocountry have to be defined somewhere as
to
> their physical or logical file and field mapping?

It requires an additional 6 lines of code.  One for the file spec and
five for the procedure interface, none of which are executable (you
might argue the F-spec).  Add another three lines for the prototype,
also non-executable.  Even with that, the code is 16 lines to 50, and a
lot easier to read.  I wasn't doing a pure comparison, Jeff, but I'll be
happy to do so once we formalize the process.

Let's see.  Other points... well, the F-spec can be used by many
procedures.  And since I'm using a logical view, I'm not even tied to a
library, table or column name.  In fact, the data can reside on another
machine entirely.

See, Jeff, I wasn't trying to do a full comparison, I was simply trying
to show that the RPG code is tighter, cleaner and easier to read, and I
think I did that quite well.


> Just because one codes a procedural method in Java, does that make
> it lose to RPG?

The term "procedural Java" just recently came into being as a response
to the recognition by OO advocates that OO is not the end-all and
be-all, and that in fact procedural code makes sense in many situations.
However, "procedural Java" is basically the worst of both worlds; an
architectural choice that requires a WHOLE LOT of mitigation to even
consider.

Especially since the "platform independence" mantra doesn't really hold
water here, because we're talking server code.  It's kind of like saying
you're going to race in the Indianapolis 500, but you're going to use
regular gasoline because you can get it everywhere.  Anyway, I just
shake my head and chuckle whenever I hear the term "procedural Java".
It's almost an oxymoron.

Joe


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.