This document describes the PowerPlant interface for OOFILE.
The PowerPlant application structure follows the generic structure described in gui.txt.
The main aim is to reduce the amount of standard user code required to manage the database. eg: if we have Add and Edit dialogs, they should be registered with a document, then you don't have to write the code to launch the appropriate dialog when the Add button is pressed.
TRANSLATING USE CASES INTO POWERPLANT OBJECTS & BEHAVIOUR
3) Adding a record
3.1 The user presses a button or chooses a menu item.
Choosing a menu item fires off the command dbAdd. The ObeyCommand for both the List and possibly an enclosing Document pass the command through mDocHelper->ObeyCommand. This would internally call addRecord().
Pressing a button sends a message to the Listener for that button. The ListenToMessage case for the Add button calls mDocHelper->addRecord();
3.2 A form appears on which they enter data and
The doc helper has had the edit dialog registered, but HOW do we call it?????
3.3 accept by pressing an OK button.
3.4 The record is saved and,
3.5 they return to the original context
GUI INTEGRATION CLASSES
dbTableMgr
Manages an embedded table, can attach buttons such as Add, Delete
dbFieldLink
Links an LControl, LEditField or LTextEdit to a database field.
Not used explicitly but manufactured by dbEditMgr::makeLink(LControl, dbField) or some overloaded variant.
dbEditHelper
Mixin for an edit dialog
Owns and manages a list of dbFieldLinks.
Also handles standard commands like dbFirst, dbPrev etc.
Provides virtual hooks you can override to perform extra validation. Just see the virtual methods in the dbEditHelper declaration.
dbBrowseHelper
Mixin for a list window. Mainly handles standard commands like dbAdd, dbEdit, dbDelete, dbDoubleClick.
dbDocHelper
Mixin for a Document class. Abstracts launching edit dialogs etc. in response from the Browser commands.
dbWindowFactory
Abstract base class. Lightweight factory objects are defined for each dialog and browser window. This uncouples application-specific windows from the OOFILE framework.
ISSUES TO CLEAR UP
1) linking buttons to embedded tables
want an easy way to say that an Add and Del button belong to a specific embedded table. Maybe have an actual field for these kind of buttons, that generates the Listener links. How get around the default of having the pane listen to all controls?
2) What's the mapping between the Add button on a list window and the menu item/parent command that adds a record? If we give in on the issue of having buttons despatch commands, this implies that the list window either
a) can generate Add/Edit dialogs, or
b) knows its caller and can pass this one up the chain
(which sounds a LOT like chain of command!!!! - so why duplicate?)