Thank you to all replies....I think Scott's article will get me going...
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Monday, January 05, 2009 4:32 PM
To: RPG programming on the IBM i / System i
Subject: Re: MVC Subfile Example
Hi Stephen,
I doubt that combining the view and controller would be a problem -- at
least it hasn't been for me. But, if you want to keep them separate,
it's just a matter of having the controller call the Model to load the
records for the subfile into an array, then having the controller call
the view and pass that array so they can be loaded into the subfile.
The April 2008 issue of System iNEWS magazine included a sample
green-screen app (by yours truly) that used a subfile, but was written
in an MVC manner. (You need a System iNEWS ProVIP subscription to read
it online)
http://systeminetwork.com/article/rpg-and-web-technologies-get-there
The code download for that article shoudl include the entire program so
you can see all of the details.
There were three other articles in that issue, written by other authors,
that re-used the Model of my green-screen to make web apps in various
other languages (Java, PHP and CGIDEV2)
Good luck
Coyle, Stephen F. wrote:
Happy new year everyone,
Can anyone point me in the direction of an example subfile
program that uses an MVC pattern? Or should the view and controller be
combined?
I've tried an MVC pattern on a single page display file but am
now thinking of trying it on a subfile. Any suggestions or past
experiences would be very helpful.
Thanks all...
- Steve