FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index mod_harbour Understanding Genesis
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Understanding Genesis
Posted: Sat Nov 09, 2019 08:57 AM

Dear Antonio,

I am using Genesis as Template for my program.
I insert some comments inside code for Ruth and Iris.
May I ask you help. Would you be so kind to look if this is correct what I write:

Can you please check the description of controller

Function of controller()
returns the args provided to Apache by the client if any if not default "browse"
Controller checks access:
cookies
user login and
requested content
depending on the AP_Method() GET or POSTan action is called ( cAction )


Controller calls view
case AP_Method() == "GET"
AP_RPuts( View( "default" ) )
|- Sends a value, converted into a string, to the client. Returns the number of bytes sent or -1 if there is an error


next step - ROUTER

state: user is logged in and made a valid request
Router() is used inside <body> to route to the selected view

here the program is routed to view - the "route" is passed through: cRoute parameter

Best regards
Otto

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Understanding Genesis
Posted: Sat Nov 09, 2019 09:13 AM
Dear Otto,

Yes, it is correct.

From a Model - View - Controller point of view:

1. Controller: It is the intermediate between the users requests and the views and data.

2. View: It is in charge of building the user interface.

3. Model: It is in charge of managing the data.

Users requests <---> Controller <---> Data and Views

We have an example of this in the first seamap.prg that was published:
https://github.com/FiveTechSoft/mod_harbour/blob/master/samples/seamap.prg
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Understanding Genesis
Posted: Sat Nov 09, 2019 01:09 PM

Dear Antonio,
thank you.
I will try to make a flow diagram for better understanding.
GENESIS is a very useful and very clean template. All that is needed for business APP is included.
Thank you so much.
Best regards
Otto

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Understanding Genesis
Posted: Sun Nov 10, 2019 01:02 AM

Continue the discussion