Confirmed users
353
edits
| Line 228: | Line 228: | ||
=== User Interface === | === User Interface === | ||
The javascript that implements the user interface is constructed using a page/component/collection pattern. A component in bughunter has the following structure: | |||
Page: Manages the DOM ready event. An instance of the page class is | |||
the only global variable that other components can access. The | |||
page class instance is responsible for instantiating components | |||
and storing them in attributes. The page class also holds any | |||
data structures that need to be globally accessible to all components. | |||
Component: Contains the public interface of the component. | |||
The component will typically have an instance of a View | |||
and Model class. The component is responsible for event | |||
binding. | |||
View: A component's view class manages interfacing with the DOM. | |||
Any css class names or HTML id's are defined as attributes of | |||
the view. Any HTML element modification is controlled with | |||
this class. | |||
Model: The model manages any asynchronous data retrieval and data | |||
structure manipulation. | |||
Collection: A class for managing a collection of Components or classes of | |||
any type. A collection can also have a model/view if appropriate. | |||
==== Class Structure ==== | ==== Class Structure ==== | ||