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



Thanks Scott. That really helps.

Would passing all of that data from the model to the controller to the
view and back again for deletes, updates, and creates be a tax on memory?
Would that hurt performance? It seems at first glance it would, but I've
never messed with this method in RPG. It works for Servlets/HTML/AJAX
implementations really well. But with everything so integrated on the i
it would seem that this is a step away from one of the advantages of a
green screen implementation.

Just trying to wrap my tiny brain around this. Its good to start the new
year learning something fun :)


Thanks
Bryce Martin
Programmer/Analyst I
Ext. 4777



Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
01/05/2009 04:41 PM
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>


To
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
cc

Subject
Re: MVC Subfile Example






hi Bryce,

Isn't the view and controller always seperate in RPG and DDS no
matter what? MVC comes in to play mostly in the web world where you
can have code that is responsible for formatting the screen data as
well as generation of said data. But in the case of coding in RPG
and DDS the DDS is the view.

It's true that the DDS is *part* of the view, but it's not the whole
thing. There's still some view logic in your RPG code, such as any
EXFMT statements, code that loads the subfile, code that handles F-keys,
etc.

Any code that's particular to the display method is part of the view.

Think of it this way: You should be able to replace one view with
another view, and have it work. i.e. if you wanted your program to
output to a fully GUI screen (such as a Windows screen) instead of a
5250 display, you should be able to bind to a GUI VIEW module instead of
a 5250 view module, and have it work.

You can't do that simply by replacing the DDS with something else,
because EXFMT, the SFILE RRN, the F-key logic, etc, will really only
work with a DDS display file.

You have to replace all of the code that's particular to the UI -- so
all of that code MUST be part of the view.

RPG is your controller and the data structures and database tables
would be your model. So just by coding in RPG and DDS you are
already coding in MVC as long as you use external datastructures and
tables.

Same is true on the MODEL end... there's more to the model than purely
the database. First of all, many people code additional business logic
apart from purely writing stuff to a DB and reading it back. They have
other stuff like calculations (how is tax calculated? How are discounts
calculated? multiply what by what?) error checking, etc, that's not
actually part of the database.

Second, the code that actually does the read, write, etc to the database
is part of the model. i.e. the SQL statements, or RPG CHAIN, READ,
WRITE, SETLL, etc op-codes are all part of it.

Just like the view, you should be able to completely replace the model
(or, it should at least be conceivable to do so) with a totally
unrelated one and have it work.


Please feel free to correct me if I've missed something.


Done.

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.