Advanced Web Technologies Lecture #3 By: Faraz Ahmed
Contents 0 Formal Notation Tool 0 MVC 0 References
Problem? A simple word processer would not be able to get those special set notations
LaTeX 0 A language 0 A specific ‘dialect’ of TeX for mathematicians/scientists
TeX 0 TeX is a system AND also a type setting language. 0 To “make” a TeX system, you need to install several components.
Installation Steps! 0 Daemon Tools ( or another similar tool). 0 Download ISO from the given link in notes. 0 Install MiKTeX (compiler) 0 Install TeXnic Center (for editing)
Relation
Design Patterns 0 Solutions to commonly occurring problems. 0 Templates on how a problem can be solved. 0 Half way through today I realized design patterns should have been there in the course!
An example to whet the appetite! 0 Singleton 0 Create a Public Class 0 Create a private constructor 0 Create a private static/shared variable 0 Initialize and expose that variable using a function/property
MVC- Motivation[1] 0 All applications contain data being manipulated by an interface. 0 That data should be disconnected with the interface.
Structure 0 Model 0 The data (ie state) 0 Methods for accessing and modifying state 0 View 0 Renders contents of model for user 0 When model changes, view must be updated 0 Controller 0 Translates user actions (ie interactions with view) into operations on the model 0 Example user actions: button clicks, menu selections
Basic MVC 0 Setup 0 Instantiate model 0 Instantiate view 0 Has reference to a controller, initially null 0 Instantiate controller with references to both 0 Controller registers with view, so view now has a (non-null) reference to controller 0 Execution 0 View recognizes event 0 View calls appropriate method on controller 0 Controller accesses model, possibly updating it 0 If model has been changed, view is updated (via the controller)
Extended MVC 0 Background: Observer pattern 0 One object is notified of changes in another 0 In extended MVC, view is an observer of model 0 Application within MVC 0 Asynchronous model updates 0 Associated view must be notified of change in order to know that it must update 0 A model may have multiple views 0 But a view has one model 0 All views have to be updated when model changes
C and C++
Disadvantages 0 Difficult to implement 0 Not suitable for smaller applications 0 Different, isolated development by UI developers, coders etc. could lead to more time. 0 Tightly coupled 0 Placing attributes that are not relevant to model e.g. popup
Advantages 0 Loose Coupling 0 Easy to unit-test 0 ??
Variants 0 The document-view Model 0 But tightly couples both view and controller.
References 1) “Model-View Controller Design Pattern”, state.edu/~rountev/421/lectures/lecture23.pdf, visited on 18th Jan 2011http:// state.edu/~rountev/421/lectures/lecture23.pdf 2) “Model-View-Controller”, visited on 18th Jan 2011http://msdn.microsoft.com/en-us/library/ff aspx