Functionaly Separated Web Development

11
Functionally separated Functionally separated web development web development Marian Marinov Marian Marinov [email protected] [email protected] jabber: [email protected] jabber: [email protected]

Transcript of Functionaly Separated Web Development

Functionally separated Functionally separated web developmentweb development

Marian MarinovMarian Marinov

[email protected]@yuhu.biz

jabber: [email protected][email protected]

PHP CodePHP CodeDatabaseDatabaseTemplatesTemplatesJavaScriptJavaScriptCSSCSS

HTMLHTML

➢You have single place for logic -> the PHP codeYou have single place for logic -> the PHP code➢In the best case you have a little logic into the DBIn the best case you have a little logic into the DB

DATABASEDATABASE FRONTENDFRONTENDBACKENDBACKEND

SERVERSERVER

1. Database which handles some to all of the 1. Database which handles some to all of the data-oriented logicdata-oriented logic

You should not have tools that:You should not have tools that:

     * retrieve all rows from a table(s) * retrieve all rows from a table(s)      * checks all rows in a table(s)* checks all rows in a table(s)     * update all rows in a table(s)* update all rows in a table(s)

       * The database should return only what you * The database should return only what you need and what you will use.need and what you will use.

     * All logic considering only data should be * All logic considering only data should be contained within the DB.contained within the DB.

     * SQL and PlSQL stored procedures are your * SQL and PlSQL stored procedures are your friends.friends.

2. Backend software which:2. Backend software which:     * receive requests* receive requests     * verify the received information* verify the received information     * retrieve the information from the DB* retrieve the information from the DB     * insert or update information into the DB* insert or update information into the DB     * apply more logic on it* apply more logic on it     * format it into desired messaging format * format it into desired messaging format XML/JSON/PLAIN TEXTXML/JSON/PLAIN TEXT     * send response to the requesting user* send response to the requesting user     * DO NOT GENERATE HTML OR CSS, * DO NOT GENERATE HTML OR CSS, generate only contentgenerate only content

3. Server software which:3. Server software which:     * handles more complex logic* handles more complex logic     * keeps a constant state of the system* keeps a constant state of the system     * executes regular or slower jobs* executes regular or slower jobs     * should be implemented only if required by * should be implemented only if required by the designthe design     * can be replaced by cron jobs* can be replaced by cron jobs

4. Frontend software4. Frontend software     * JavaScript based software * JavaScript based software      * Use JavaScript frameworks (jQuery, * Use JavaScript frameworks (jQuery, Prototype, ExtJS)Prototype, ExtJS)     * Handles all the logic of the user interface* Handles all the logic of the user interface     * changes dynamically * changes dynamically      * uses only client resources for changing* uses only client resources for changing     * requests content from the server* requests content from the server     * sends actions to the server* sends actions to the server

5. Requirement of this architecture5. Requirement of this architecture     * You have to use the same messaging * You have to use the same messaging format between common modulesformat between common modules

     * Parameters between modules MUST be * Parameters between modules MUST be negotiated in the beginingnegotiated in the begining

     * You should use common error report codes* You should use common error report codes

6. Benefits of the architecture6. Benefits of the architecture     * Ease of adding new modules* Ease of adding new modules     * Ease of extending current modules* Ease of extending current modules     * You are not a slave to a single messaging * You are not a slave to a single messaging formatformat     * Having different versions of the frontend * Having different versions of the frontend doesn't require different versions of the doesn't require different versions of the backendbackend     * Better scalability * Better scalability      * Better performance (since almost all of the * Better performance (since almost all of the frontend logic is computed at the client side)frontend logic is computed at the client side)

THANK YOUTHANK YOU

Marian MarinovMarian MarinovSystem Architect at Siteground.comSystem Architect at Siteground.com

[email protected]@[email protected]@jabber.org

http://hydra.azilian.nethttp://hydra.azilian.net