Felipe Pollola Paulo Vitor MVC ModelViewController About Turbo
Felipe Pollola Paulo Vitor
MVC (Model-View-Controller); About Turbo. Gears; Turbo. Gears Installation; Creating a Project; Starting a Project; Implementing basic configurations to a Project; References. 2
Applications default architecture, also used in design-patterns, meaning an easily communication, documentation and systems learning. The vision is to separate logic application (Model Layer), of interface to user (View Layer) and of application flux (Controller Layer). Permits that the same business logics can be accessed and seen by various interfaces. 3
Model: Model represented in a project low level structure. Could be an object-relational model that implements the data layer, or in interface MVC case, it could store state informations of controllers. Controller: Implements the layer responsible to manage events in the project, like: User clicks that call the Model layer to process events. Also it can store state informations of user in the application. View: Generate an user interface in agreement to request the processing of events in Controller Layer. 4
Turbo. Gears components: * Mochi. Kit: Java. Script library ; * Kid: Templating language; * Cherry. Py: Base Web framework; * SQLObject: Object-relational mapper (ORM). Examples of Companies that uses it: * IBM; * Adobe. 5
The installation guide of Turbo. Gears can be found in Twiki. Link: http: //twiki. on. br/bin/view/DEV/Turbo. Gears 6
It recommends that the developer creates a folder base to store the Turbo. Gears created projects. Example: /home/{username}/Turbogears Situated in destiny folder, execute the command tgadmin quickstart to create a new project in aggreement with decisions of the creator. Example: /home/[username]/Turbogears {username}@{hostname}: ~/Turbogears> tg-admin quickstart 7
Thus that executing command, automatically it will, at console, work all processes to project creation. Example: {username}@{hostname}: ~/Turbogears> tg-admin quickstart Enter project name: Then, set a project name; the packet can be the same name of project; a Identity means that Turbo. Gears will be able to supply the prepared code to that kind of solution, like authentication and authorization (“Not using” it is the standard given). After this, your project will be created in the folder defined before. Example: /home/{username}/Turbogears/{project_name} 8
It's possible to initiate the operations with the Turbo. Gears using standard configuration. For this, type in your console in the previously cited folder this command: . /start{project_name}. py ou python start{project_name}. py Example: {project_name}. py /home/{username}/Turbogears/{project_name}/python start- 9
For recommendation, the ideal is not to keep the standards configurations of the Turbo. Gears. Because, for example, the port used for your project in the Turbo. Gears can be being used by another applicattion then causing an error. Example: Exception in thread CPHTTPServer Thread-2: error: (13, 'Permission denied') Then to configure this type of situation in Turbo. Gears it's necessary to edit “dev. cfg” located in the origin folder of the project (project name), and go to the written line as “SERVER” in “# server. socket_port=8080” to choose for which port will have to transmit the information desired, removing the commentary of the line. 10
Some other disabled standards can be modified in this configuration archive and enabled, such which: DATABASE, LOGGING, etc. After this, initiates the project above Turbo. Gears as guided, and goes to the name folder [project name] referenced in the origin folder. 11
Web. Sites: Turbo. Gears Official Site - http: //www. turbogears. org/ O Turbo. Gears - http: //oturbogears. org/ Portuguese Discussion Group of Turbo. Gears - http: //br. groups. yahoo. com/group/turbogears-pt/ TG Documentation - http: //tg. maetico. com/api/ 12
- Slides: 12