WCCCE 2018 Supporting Files
A Simple MVC Framework for Web Development Courses
- Taught in week 3 of CSC309, prerequisites DB, C, Java, Design Patterns
-
- What framework to choose?
- Want to cover the right concepts: control flow, separation of concerns, templating, validation, page lifecycle, ...
- These are CS students, they should understand how this all works.
Use this as an exercise in understanding how the lower
levels of the web work. Most frameworks try really hard to hide the engine.
- Want to do this quickly. We are going to go to Node+React+RestAPI anyway.
- Want the knowledge to be transferrable, so if they understand this MVC framework, they should be able
to understand any other one.
- What using a simple framework looks like (DJango)
Our Framework
- What the documentation looks like ... NONE, just read the code!!!!
And there is practically none! SIMPLE, CLEAR, CONCISE
- MVC: Separation of concerns
- Front Controller running a State Machine give you
- Page flow control
- Page lifecycle control
- Easy to use, maintain
- Easy to add features such as
- page tokens to prevent back button issues, CSRF
- Templating: just use require in PHP!
Example
- Guess Game with a simple object model: play (user=arnold, password=something), code
- Guess Game with a real object model: play (user=arnold, password=something), code
- CSC309 18S which used the framework in week 3.
Video Games as a Vehicle to Deliver CS Content: Warehouse Wars