Understanding Genesis

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!

Understanding Genesis

Postby Otto » Sat Nov 09, 2019 8: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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6333
Joined: Fri Oct 07, 2005 7:07 pm

Re: Understanding Genesis

Postby Antonio Linares » Sat Nov 09, 2019 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42113
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Understanding Genesis

Postby Otto » Sat Nov 09, 2019 1: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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6333
Joined: Fri Oct 07, 2005 7:07 pm

Re: Understanding Genesis

Postby Otto » Sun Nov 10, 2019 1:02 am

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6333
Joined: Fri Oct 07, 2005 7:07 pm


Return to mod_harbour

Who is online

Users browsing this forum: No registered users and 8 guests