Couple questions Mqueue.
Use procedures for retrieving each field or putting into each field. Then
when the record format changes, only the service program needs to be
recompiled and any other program or service program that needs the new or
changed field(s).
Do you do this for every table accessed from RPG? And if so, what is the
reasoning behind it based on the fact that you lose easy access to files
(i.e. CHAIN, SETLL, READE, etc) and instead now have to take the time to
encapsulate to the n-th degree and maintain each one of those modules.
I am asking because there is a place for what you describe, but I would only
ever use it for PF's that are being changed frequently and are used in many
RPG programs. If that isn't the case then you spending MORE time building
and maintaining DAO's (Data Access Objects) vs. just going direct to the
files with our second-to-none ease of DB access opcodes.
Aaron Bartell
http://mowyourlawn.com
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of MQueue
Sent: Monday, September 24, 2007 6:40 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: MVC in RPG?
Mike,
That's so cool. That's what I've been wanting to do, also.
On one project, we had separated the DB functionality. In our case too much
business logic was placed in it. One thing that I noticed and would change
in the future is to not return the record format or it's address. The
record format should only exist in the service program containing the DB
procedures. Use procedures for retrieving each field or putting into each
field. Then when the record format changes, only the service program needs
to be recompiled and any other program or service program that needs the new
or changed field(s).
Create an instance. Besides the key fields include the "initial" program
that is called, especially if you maintian created by and changed by
information. Otherwise all the created by and change by program would be
the DB service program. That is also helpful for business logic as to where
to send error messages. (Include the module if you take program message
queues to that level.)
What are you using for modeling? Are you going to use data and process
modeling or object moduling?
MQueue
As an Amazon Associate we earn from qualifying purchases.