Peter wrote:
has anyone an approach how to use Win32::GUI with the Model-View-Controller
(MVC) principle? Or if that would be impossible: What would be the best way
to separate business code and gui?
In a previous Win32::GUI app I provided both a CLI and a GUI interface.
I used one class for the actual application/business logic, one base class
for the abstract UI and one subclass each for the CLI and the GUI interface
(that is basically a variation of the Model-View-Controller pattern with
the View and Controller merged).
The interfaces between the app/GUI-classes had to evolve a lot during
implementation since I didn't anticipate many of the interactions between
the app and the UI. An interesting observation is that the actual business
logic was kind of small compared to the UI code.
I designed the UI subclass for Win32::GUI as a singleton to avoid all the
global vars. Ideally I would like to see the option of subclassing e.g.
Win32::GUI::Window and have the event methods called as methods on that
object instead; the singleton is really just a workaround for that.
/J
--
Johan Lindström, Sourcerer, Boss Casinos Ltd, Antigua
[EMAIL PROTECTED]