For the web sites of the family of brands of a major retailer, I created a "widget" to handle site search requests that used several interactive animations and responsive behavior, including type-ahead suggestions gathered via AJAX interaction with backend servers.
This configurable standalone GUI widget was written in essentially raw JavaScript, and it used the MVCCE design pattern.
Below is the design diagram (click to expand) that was the blueprint for that widget.
Click to Expand
Following the "single flow" of data from left to right,
- User Actions (i.e. things a user wants to do, use cases, etc),
- are invoked by the user causing DOM Input Events (by clicking or typing or moving cursor),
- which are caught by Controllers,
- which decide which Command to invoke, with which parameters to send,
- which uses Model APIs to manipulate/update the widget's (and/or application's) state,
- which causes Update Events to be sent to Views which are "Observing" those Models,
- and those Views use the DOM APIs to manipulate/update the browser display.
This widget, at the "compound" level, did not happen to generate Output Events for other Controllers to subscribe to.
As can be seen, several models, views, controllers are "composite" containing sub-components.
While it is less obvious from the diagram, the AJAX interactions with the server-side, result in Input Events from the async replies to data requests (e.g. type-ahead suggestions), which update the Models, which in turn cause the Views to update themselves (including the loading of images that correspond with the type-ahead suggestions).
While it is less obvious from the diagram, the AJAX interactions with the server-side, result in Input Events from the async replies to data requests (e.g. type-ahead suggestions), which update the Models, which in turn cause the Views to update themselves (including the loading of images that correspond with the type-ahead suggestions).
No comments:
Post a Comment