New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
MVC for Desktop Application - Part 2
1. Introduction to MVC for Desktop Application Course C1001 He Shiming2010-9 射手科技 (SPlayer.org)
2. MVC in Web Applications introducing agile web development with ruby on rails 射手科技 (SPlayer.org)
3. Rails Framework and MVC Model represents information, tables and their relations, basic queries of data, the fundamentals of business logic View represents user interface, the presentation of data and business logic Controller is the glue between View and Model, responding to actions from View, and deciding which Model to use or what kind of logic to follow 射手科技 (SPlayer.org)
7. Rails View app/views/staffs/index.html.erb<h1>Listing staffs</h1><table><tr><th>Name</th><th>Age</th></tr><% @staffs.each do |staff| %><tr><td><%=h staff.name %></td><td><%=h staff.age %></td> </tr><% end %></table> 射手科技 (SPlayer.org)
8. Rails Controller app/controllers/staffs_controller.rbclass StaffsController < ApplicationController# GET /staffs# GET /staffs.xmldefindex@staffs = Staff.all respond_to do |format|format.html # index.html.erbformat.xml { render :xml => @staffs } endend 射手科技 (SPlayer.org)
9. Development of This App Database engineers can focus on table design, data validation (Model) Front-end designers can focus on visual design, only need to learn HTML-like special tags (View) Business logic developers can focus on workflow, logic design, no need to work closely with front-end designers or database engineers (Controller) 射手科技 (SPlayer.org)
10. Rails Framework Achieved: Complete isolation of presentation (UI) and business logic (database and queries) Independent and parallel development of web application Very low inter-connection of application components (low-coupling) 射手科技 (SPlayer.org)