Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Separating Business Logic from User Interaction (Userforms)
Hi everybody !
I want to tidy up an Excel VBA project. The principal interface is a form with four meaty pages. Being new to all this I initially coded much of the business logic into the form class module, interacting with a collection class object which held much of the data. This lead to several thousand lines of code being housed in the form class module. This was a prototype and it served its point. I now wish to develop the code afresh for the full-blown software. I have read that it is best to separate out the user interaction code from the business logic, and I certainly agree. I intend placing code for each form page in separate standard modules, leaving the interface code in the form class module, and the class object where it is. From this I have 2 questions I would like a little guidence with. 1. Should I create a User Interface Support (UIS) class module to handle interaction between the form class and the individual standard modules, or should I just have the form class and standard modules ? What are the merits of a UIS layer ? 2. Consider the following. I pass a list box user selection to the UIS layer and then to the business logic layer, and on interrogation that layer needs to return more than one value back to the interface layer to populate more than one control box with return values. How should I code the Business logic layer to pass these multiple independent values back through the UIS layer and finally to the interface layer ? Or should I scrap the UIS layer ? (My ambling thoughts: would each layer have to use a raise event to pass upwards an array of values or function return ? Would I have to pass each value upwards separately ? And if so, how ?) Thanks in advance for any assistance you can offer. chatterbox |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How Email does not need user interaction ? | Excel Discussion (Misc queries) | |||
How do I protect my hidden Excel.Application object from unwanted user interaction. | Excel Programming | |||
What's the best way to deploy a VB business logic with Excel? | Excel Programming | |||
Pivot tables-controlling user interaction with pivot tables | Excel Programming | |||
Modeless form for user interaction | Excel Programming |