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