Client-side
Parke Godfrey
19 October 2012
CSE-2041
Parke Godfrey
19 October 2012
CSE-2041
Communicating with the servers.
Handling the content for the user.
Rendering the page.
Controlling behaviour (locally) of the “page” / webapp.
E.g.,
user clicking links,
user filling in forms.
model
Manages the data (the content).
Defines the interactions possible with the data.
view
Defines how to render the content into a presentation.
Defines how to interact with the content.
There can be multiple views for the same model.
controller
Manages the interactions via the view against the model.
model
The “page” delievered from the server. (HTML)
view
Client renders the page in some appropriate way.
Can we abstract this more in a useful way?
controller
Hardwired Web behaviour handled by client / browser.
What about richer behaviour specific to a webapp?
Can handle in a back-and-forth to the server / CGI program, but that is so “Web 1.0”!
model
The “page” delievered from the server. (DOM)
view
Client still renders the page in some appropriate way.
Defined by style directives. (CSS)
Style is separated from content.
controller
Hardwired Web behaviour still handled by the client browser.
Handles logic of the webapp — that defines the webapp's specific behaviour. (JavaScript)
declarative
State what we want “rendering-wise”, but not how it is to be accomplished.
No procedural instructions. (We may not be able to anticipate the structure of the document.)
specification
Gives instructions for how things should look in concept.
This is like markup for
“typesetting”;
e.g., ROFF
& LaTeX
.
We can specify as little or as much as we want.
It is up to the device how it is actually rendered.
What must CSS look like to pull off this trick of declarative and specification (of as little or as much as we want)?
Express CSS rules for format & layout specifications over the structure of the HTML (DOM).