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



"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 09/15/2016 01:33:26
PM:
A colleague of mine proposed to create a service program for each
new table, implementing the CRUD functionalities in SQL. We would be
using the functions from the service program to access the files
instead of native RPG I/O.

This is basically the path we started down about three years ago.
We create an MVC framework for our environment and all application
development is using this model -- whether interactive or batch. The
framework is laid out as follows:

1. VIEW -- is a DSPF DDS which is used by the operating system to
management interface between a CONTROLLER and an interactive interface
(whether it be green-screen or browser-based; and we are using the
Profound Logic rich display file for the browser interface)
2. CONTROLLER -- is an RPG LE, non-SQL program to manage the interface
between an MVC service layer (for business logic) and the VIEW
3. MVC Service Layer -- is an SQL RPG LE service program to apply
business logic and support SELECT access (via SQL views, only) to manage
the interface between the MODEL and the CONTROLLER
4. MODEL -- is an SQL RPG LE DAO service program to support INSERT,
UPDATE, and DELETE access to a single underlying SQL table (must be the
physical file)

Now, first let me say that I know many purists will object to
splitting SELECT access off from the rest of the functions of the MODEL.
But, that is just the way they decided to do it here. They justified it
based on restricting all SELECT access to SQL Views, only. At least it
gets the file I/O out of the CONTROLLER -- which is the biggest no-no in
the MVC world.

Anyway, to continue... We allow CONTROLLERS to call CONTROLLERS
but a CONTROLLER can only reference a single VIEW and a single MVC service
layer. The service layer can call oher service layers as needed but may
only call a single DAO MODEL and no other service layer can call the same
DAO MODEL. To access other DAO MODELs a service layer must call the
associated service layer.

RPG-auto-generated data structures for either the display view,
the SQL view, or the SQL table are passed by reference as parameters
between the layers of the MVC framework.

Sincerely,

Dave Clark

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.