Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Buffering Architecture
Message
From
16/01/2008 09:07:05
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
16/01/2008 08:56:02
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01282147
Message ID:
01282175
Views:
8
>>All your forms should be based on the same form class. Data buffering, saving and un-doing changes, should be part of this class.
>
>How difficult is it to convert a form to use another base form?

That would depend on how it is programmed. But it is worth-while to go ahead and base your forms on classes.

Of course, if your forms are already based on classes, you can put the buffering in these classes.

>
>>Your class hierarchy might look like this (parent on left, children on the right):
>>
>>
>>Form
>>|
>>|--- cForm
>>     |
>>     |--- cDataForm
>>     |--- other forms, including dialogs, reporting forms, ...
>>
>>
>>I.e., all your forms ultimately derive from a class cForm; forms that need to manipulate data derive from cDataForm.
>
>I think I need a bit more explanation on this part. Forms that don't use data, and those that do, are based from the one cForm? And if there are forms that use data, then those would be based from the cDataForm?
>
>>This data form typically has methods to:
>>
  • Check if there are changes to the current record (using GetFldState()
    >>
  • Save changes
    >>
  • Undo changes
    >>
  • Go to: next record, previous record, first record, last record
    >>
  • Ask for permission to go to another record or close form. This method - which might be called .CanChange() or something - will be invoked by .NextRecord(), .PreviousRecord(), etc. It will also be invoked in .QueryUnload(), if the user tries to close the form.
    >
    >Would you build navigation and add/edit/save/cancel buttons into this form, or just have methods available and design another class to do the visual stuff?

    In any case, you should have methods. The reason is that the methods may be called from outside the forms, e.g. from the main menu, or from the main toolbar.

    Whether you then add the buttons to the form is a minor esthetical detail. The button would just invoke the method, e.g. ThisForm.GoNext().
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
  • Previous
    Next
    Reply
    Map
    View

    Click here to load this message in the networking platform