Table of Contents
Previous Section
So how exactly are request-handling messages propagated from a component to its HTML elements? This question begs another: What is the relationship between component and HTML element?
Both WOComponent objects and HTML elements (static and dynamic) share a common ancestor, WOElement. WOElement declares, but does not implement, the three request-handling messages: takeValuesFromRequest:inContext:, invokeActionForRequest:inContext:, and appendToResponse:inContext:. This common inheritance, of course, makes it possible for both components and HTML elements to participate in request handling. But there the inherited similarities end. Although components can generate HTML content, this capability is not a essential characteristic, as it is with objects on the other branch of the inheritance tree.
Components are reusable pages, or portions of pages, displayed in a World Wide Web browser. As with all objects, components contain a unique set of data, although the structure of that data is the same for each component instance. Through a script or compiled code, components also include logic that manipulates the data and otherwise affects behavior, especially the behavior of returning another page based on a user's request. Finally, each component is associated with a template.