advanced web technologies
DESCRIPTION
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. - PowerPoint PPT PresentationTRANSCRIPT
Advanced Web Technologies
Lecture #3By: Faraz Ahmed
Contents
0Formal Notation Tool0MVC0References
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
0TeX is a system AND also a type setting language.
0To “make” a TeX system, you need to install several components.
Installation Steps!
0Daemon Tools ( or another similar tool) .
0Download ISO from the given link in notes.
0 Install MiKTeX (compiler)
0 Install TeXnic Center (for editing)
Relation
Design Patterns
0Solutions to commonly occurring problems.
0Templates on how a problem can be solved.
0Half way through today I realized design patterns should have been there in the course!
An example to whet the appetite!
0Singleton
0 Create a Public Class0 Create a private constructor0 Create a private static/shared variable0 Initialize and expose that variable using a
function/property
MVC- Motivation[1]
0All applications contain data being manipulated by an interface.
0That data should be disconnected with the interface.
Structure
0 Model0 The data (ie state)0 Methods for accessing and modifying state
0 View0 Renders contents of model for user0 When model changes, view must be updated
0 Controller0 Translates user actions (ie interactions with view) into
operations on the model0 Example user actions: button clicks, menu selections
Basic MVC
0 Setup0 Instantiate model0 Instantiate view0 Has reference to a controller, initially null0 Instantiate controller with references to both0 Controller registers with view, so view now has a (non-null) reference
to controller
0Execution0 View recognizes event0 View calls appropriate method on controller0 Controller accesses model, possibly updating it0 If model has been changed, view is updated (via the controller)
Extended MVC
0Background: Observer pattern0One object is notified of changes in another0 In extended MVC, view is an observer of model
0Application within MVC0Asynchronous model updates
0Associated view must be notified of change in order to know that it must update
0A model may have multiple views0But a view has one model0All 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
0Loose Coupling
0Easy to unit-test
0 ??
Variants
0The document-view Model
0But tightly couples both view and controller.
References1) “Model-View Controller Design Pattern”, http://www.cse.ohio-state.edu/~
rountev/421/lectures/lecture23.pdf , visited on 18th Jan 20112) “Model-View-Controller”, http://msdn.microsoft.com/en-us/library/ff649643.aspx , visited on 18th Jan
2011