Framework What is Framework Framework is the structure

  • Slides: 13
Download presentation
Framework

Framework

What is Framework? Framework is the structure to build your program. Essentially a framework

What is Framework? Framework is the structure to build your program. Essentially a framework is the structure that you can choose to build your program on. It can allow you to connect to many different API's as well as determine the structure of your own application. Frameworks provide scaffolding that can allow you to develop faster/more cleanly. They often provide toolsets for both the UI components and the underlying database access.

Frame work structure Architectural Pattern from Smalltalk (1979) Decouples data and presentation Eases the

Frame work structure Architectural Pattern from Smalltalk (1979) Decouples data and presentation Eases the development

Frame work structure Server Client Database First thought (ok, but not far enough): Tier

Frame work structure Server Client Database First thought (ok, but not far enough): Tier 1: View (Client) Tier 2: Controller (Server) Tier 3: Model (Database)

Frame work structure Server Client Presentation Database Presentation: View is the user interface (e.

Frame work structure Server Client Presentation Database Presentation: View is the user interface (e. g. button) Controller is the code (e. g. callback for button) Data: Model is the database

Example Control Flow in MVC User interacts with the VIEW UI – CONTROLLER handles

Example Control Flow in MVC User interacts with the VIEW UI – CONTROLLER handles the user input (often a callback function attached to UI elements) – CONTROLLER updates the MODEL – VIEW uses MODEL to generate new UI – UI waits for user interaction

Our framework folder structure Classesmodule Classestpl Data Images Lib Services Smarty pear Add third

Our framework folder structure Classesmodule Classestpl Data Images Lib Services Smarty pear Add third party plugin folder like 'PHPExcel' etc. .

Explain in file level Main Controller – Service/wrapper. php Custom Controller • Classesmodule/files Model

Explain in file level Main Controller – Service/wrapper. php Custom Controller • Classesmodule/files Model – classes/files Custom Model • Classestpl/files View – smarty/templates/files

Third party plug-in and support folder Third Party plug-in – Pear (Pear for database

Third party plug-in and support folder Third Party plug-in – Pear (Pear for database connection) – PHPExcel (Read and write excel document) – Xajax (xajax library files) – HTML 2 PDF (Convert html to pdf) etc. . Other folder for some purpose – Lib (configuration files) – Images (having all images) – QUERY_FILE (write tracking files) – webservice (web service related files) etc. .

Configurable There are some situation, we need to change some things through out product.

Configurable There are some situation, we need to change some things through out product. Example: – Pagination We must use pagination as configurable, if we changed in configuration file it will reflect through out product. Some more example: – Static URL – Product base path etc. .

Mapping using database In our own framework we use some mapping concept with respect

Mapping using database In our own framework we use some mapping concept with respect to user type. Basically there are three type of user in all product. – – – User Administrator Super Administrator Based on user type they may get different type front end view and display using the following mapping. – – – template module mapping template with respective module

Structure of our framework View Controller User interface view controller services/wrapper. php checking mapping

Structure of our framework View Controller User interface view controller services/wrapper. php checking mapping and template Model classesmodule/files module data classestpl/files classes/files Model common. php

Example code wrapperscript('login', login. User); process. Data("wrapper", module. Name, formvalues, ""); wrapper('login', formvalues); return

Example code wrapperscript('login', login. User); process. Data("wrapper", module. Name, formvalues, ""); wrapper('login', formvalues); return success or failed If success then redirect to menu or home page module