Model-View-Controller Architecture in a Systems Analysis and Design Course Dr. Robert F. Zant Illinois State University
The Plan Curriculum overview MVC Concepts Example MVC implementation
Curriculum Structure
Systems Development I Taken by all IS majors Covers Traditional and Object-Oriented SAD
Systems Development II Taken by IS majors in Systems Development/Analyst Sequence Covers Traditional SAD Includes Simulated Project
OO Systems Development Taken by IS majors in Web Application Development Sequence Covers Object Oriented SAD Includes Simulated Project
Directed Project in Information Technology Taken by IS majors in both sequences Includes Real-World Project
Curriculum Structure
MVC Architecture Used in both second level courses as a unifying theme Provides an architectural template for novice system developers Use is prevalent in industry
MVC Structure
MVC Controller - Interprets user requests and invokes Model and View Model - contains application logic and access logic for persistent data View - displays model results to user
Primary Data Flow
Server Side Programming
Client Side Interface Design
Guidelines All responses from users are processed first by a Front Controller Communication of user responses to the Front Controller is by name (e.g., field names on HTML forms) A Front Controller invokes a Page Controller, not a Model or View A Page Controller invokes one Model and one View
Guidelines (cont.) A Model executes application logic and accesses data stores (contains no HTML) A Model creates an XML file or an object containing its results Communication of Model results to a View are by name (e.g., tags in XML)
Guidelines (cont.) A View creates a presentation stream A View contains no application logic A View obtains all non-constant text data from the XML file or result object produced by the Model A View does not directly reference any data in a Model or URL for the site
Example Front Controller <% NOTE: This is the Front Controller ; DEFAULT pc = "menu", sys_base = $path_Translated_dir$"/", url_base = home = $url_base$index.odb ; SESSION LOGIN = "login.odb?from=$pc$", TIMEOUT = 10 ; INCLUDE $sys_base$"c/"$pc$".c"; %>
Example Page Controller <% NOTE: Page Controller to List Products ; INCLUDE $sys_base$m/Products/table1.m ; INCLUDE $sys_base$v/Products/table1.v ; %>
Example Model <% NOTE: Model to List Products ; DATABASE "DSN=myProducts" ; SELECT Category, ProductID, Heading, Description, UnitPrice, UnitsOnHand FROM Products ORDER BY ProductID ; OUTPUT $xmlfile$ ; NOTE: xmlfile defined during login; %> $home$
Example Model (cont.) $ProductID$ $Category$ $Description$ $UnitPrice$ $UnitsOnHand$
Example XML File 3 Reinforced plastic 8 inch Plastic Widgets Oversized polyethelene with steel
Example View SET xslt = $url_base$"v/Products/xslt/table1.xslt" ; INCLUDE $xmlfile$ ;
Example XSL <xsl:stylesheet version="1.0" xmlns:xsl=" <html xmlns=" lang="en" xml:lang="en"> World Wide url(v/widgets.css);
Example XSL (cont.) World Wide Widgets [ Continue... ]
Example XSL (cont.) Products by Product ID Product ID Product Category Description Price On Hand
Example XSL (cont.) <xsl:value-of select="format-number (UnitPrice,'$###,##0.00')" />
Recommended Software ODB Script – Abyss Web Server – Cooktop – TextPad –
Thank You Questions?