Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Buffering Architecture
Message
 
 
To
16/01/2008 08:46:15
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
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:
01282189
Views:
7
>>I'm working on a form that I want to use data buffering on. I can do this. TableUpdate, TableRevert, cascades if needed and all that jazz. But, we are thinking that we want to have a more global approach in our app so we can use the same schema for all of our forms and data. Maybe a DataBuffering class or something? Something we can sort of drop on a form and have it handle much of the heavy lifting. Any ideas on how to best approach this or if there are examples/samples already out there? Thanks!
>
>All your forms should be based on the same form class. Data buffering, saving and un-doing changes, should be part of this class.
>
>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.
>
>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.

    Hi Hilmar,

    I agree with your approach, but I believe the exact code or Save/Undo, etc. should be handled by the BO and Data Access class.

    There are frameworks available, some of them free.
    If it's not broken, fix it until it is.


    My Blog
  • Previous
    Next
    Reply
    Map
    View

    Click here to load this message in the networking platform