M
Mark Driscol
On page 44 of the excellent Bullen/Bovey/Green book, "Professional
Excel Development," it states:
"Within the user-interface tier of many Excel applications lie two
unique subtiers. These consist of the workbook and sheet elements used
to construct the user-interface and the code supporting those elements.
The concept of separation should be rigorously applied to these
subtiers. A workbook-based interface should contain no code, and the
UI code that controls a workbook-based interface should reside in an
add-in completely separated from the workbook it controls."
In my application I have the following.
User-interface: a userform and a worksheet
Business logic: standard code modules
Data storage: a worksheet
There are certain ranges on the worksheet that forms part of the user
interface. If I put Get and Let properties in the code module behind
this worksheet that allow for data storage and retrieval, I can access
the ranges' data from my standard code modules (business logic). That
would eliminate i) declaring global range objects to be used among the
various code modules, or ii) passing range objects as arguments among
the macros that would use them. However, if I do put properties in the
code module for the user interface's worksheet, will I be violating the
principles cited above from the book? What is best practice? Will I
not be properly isolating the user interface from the business logic?
Thanks in advance.
Mark
Excel Development," it states:
"Within the user-interface tier of many Excel applications lie two
unique subtiers. These consist of the workbook and sheet elements used
to construct the user-interface and the code supporting those elements.
The concept of separation should be rigorously applied to these
subtiers. A workbook-based interface should contain no code, and the
UI code that controls a workbook-based interface should reside in an
add-in completely separated from the workbook it controls."
In my application I have the following.
User-interface: a userform and a worksheet
Business logic: standard code modules
Data storage: a worksheet
There are certain ranges on the worksheet that forms part of the user
interface. If I put Get and Let properties in the code module behind
this worksheet that allow for data storage and retrieval, I can access
the ranges' data from my standard code modules (business logic). That
would eliminate i) declaring global range objects to be used among the
various code modules, or ii) passing range objects as arguments among
the macros that would use them. However, if I do put properties in the
code module for the user interface's worksheet, will I be violating the
principles cited above from the book? What is best practice? Will I
not be properly isolating the user interface from the business logic?
Thanks in advance.
Mark