advanced web technologies

22
Advanced Web Technologies Lecture #3 By: Faraz Ahmed

Upload: abiba

Post on 22-Feb-2016

30 views

Category:

Documents


0 download

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 Presentation

TRANSCRIPT

Page 1: Advanced Web Technologies

Advanced Web Technologies

Lecture #3By: Faraz Ahmed

Page 2: Advanced Web Technologies

Contents

0Formal Notation Tool0MVC0References

Page 3: Advanced Web Technologies

Problem?

A simple word processer would not be able to get those special set notations

Page 4: Advanced Web Technologies

LaTeX

0 A language

0 A specific ‘dialect’ of TeX for mathematicians/scientists

Page 5: Advanced Web Technologies

TeX

0TeX is a system AND also a type setting language.

0To “make” a TeX system, you need to install several components.

Page 6: Advanced Web Technologies

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)

Page 7: Advanced Web Technologies

Relation

Page 8: Advanced Web Technologies
Page 9: Advanced Web Technologies

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!

Page 10: Advanced Web Technologies

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

Page 11: Advanced Web Technologies

MVC- Motivation[1]

0All applications contain data being manipulated by an interface.

0That data should be disconnected with the interface.

Page 12: Advanced Web Technologies

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

Page 13: Advanced Web Technologies

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)

Page 14: Advanced Web Technologies
Page 15: Advanced Web Technologies

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

Page 16: Advanced Web Technologies
Page 17: Advanced Web Technologies

C and C++

Page 18: Advanced Web Technologies

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

Page 19: Advanced Web Technologies

Advantages

0Loose Coupling

0Easy to unit-test

0 ??

Page 20: Advanced Web Technologies

Variants

0The document-view Model

0But tightly couples both view and controller.

Page 21: Advanced Web Technologies
Page 22: Advanced Web Technologies

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