"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 09/16/2016 01:57:42
PM:
@Dave Clark: Could you recommend some reference material on the MVC
framework you described. I don't think I fully grasp that way of working
yet.
I don't really have any references, per se, but MVC (Model, View,
Controller) is common in the OO world. You should be able to find good
information on that through Google. All you are faced with is
understanding what MVC is and then decide how you're going to impliment it
in the RPG LE world. IBM has already done part of that for you with
externally described files -- be it display, printer, or data files.
So the display file or the printer file is your MVC VIEW. The MVC
MODEL would be an RPG LE service program which provides DAO access to any
underlying data files (tables). Whether you decide to include SQL SELECT
services directly through your MVC MODEL or not is up to you.
However, since an MVC MODEL is supposed to be for a single data
table (to my understanding), then what are you going to do about SQL views
which can join disparate tables? That is why we chose to offer up SQL
SELECT services through a business logic service program -- where the MVC
framework allows for what is termed a "service layer" in addition to the
usual three layers of Model, View, and Controller.
Then, all that is left is the MVC CONTROLLER. In the RPG LE
world, this should always be a standalone non-SQL RPG LE program that
simply manages the interface between its associated MVC VIEW and MVC MODEL
or MVC Service Layer for Business Logic.
Sincerely,
Dave Clark
As an Amazon Associate we earn from qualifying purchases.