java.lang.Object | +----java.awt.Component | +----java.awt.Container | +----java.awt.Panel | +----java.applet.Applet | +----AVQuery
Operation Notes
The applet allows the user to enter a query term in Altavista's standard (i.e. not the "advanced" setting) query format and shows the resulting result set consisting of hits to other web pages. The user can control the number of hits to load from the server via a simple setting.
Note that the server requesting is entirely synchronous, that is, the user enters a new search term and the program does not come back to be controlled until the search results are received.
Architecture Notes
The applet is divided according to the MVC architecture. It looks like this:
The ResultsModel is completely separated from UI, View, or Controller code. The Views and Controllers all make use of UI components by object composition rather than inheritance. That way the GUI appearances and behaviour can be modified without changing the interfaces of these components.
Finally, note that the AVQuery object is in a priveleged position compared to the MVC components: it does the component construction, understands the MVC connections, and knows about the overall UI and how to place sub-components of the interface on them. For that reason, it knows about the TextArea used to display the results.
public AVQuery()
public void init()