Design Question

  • Thread starter Thread starter Lampy
  • Start date Start date
L

Lampy

Hi,

I have an app that will use a tab control on a form. This is the first time
working with tabs so I am trying to find out the best approach on saving
data entered. Each tab will have user input that will need to be saved.
Should I have a control class for that form and each time the user moves
through each tab the user input is passed to the control class to be saved?
Any ideas?

Thanks in advance
 
Hi,
Automatically saving data for each when the user moves out of the tab would
mean taking the control away from the user.
You could provide an "Apply" (apart from the "Ok" and "Cancel" buttons)
button which would specifically save the changes.

Hope this helps.

Regerds,
Sankalp
 
Agreed. And have designed it to save when the user exits the form with the
tab control. However, I still have a question about persisting the data.
What is the best approach? Do I create a control class that form and pass
the data into that class and perist it that class? Basically, I am looking
for an overall design suggestion.
 
Hi,

You could use XML Serialization to persist the data.
(http://www.dnzone.com/showDetail.asp?TypeId=2&NewsId=79&LinkFile=page1.htm)
..

You could probably extend the process of serialization/deserialization by
passing the data on a form in some kind of structure. This structure would
mimic the name-value pair (in this case the control would be the NAME and
the data in the control would be the VALUE). You could probably pass
multiple structures in an array to the class that is responsible for
serializing/deserializing.

Apart from XML Serialization, Binary Serialization can also be used. It
basically depends on the requirements. If you do not want users to read this
data, then binary serialization would be prefered.

Regards,
Sankalp
 
Thanks for your response. I understand how to use serialization to persist.
My question is how to design it. Do I design it when the form is closed I
pass the data to the UI control class to persist it based if the form is
Dirty? I guess I am trying to see if it is a good design to have a UI
process control class for each form and have it control all the process
including persistence? I am just looking for ideas on how others design
their UI process?

Thanks
 
Back
Top