Thursday, 29 August 2013

Design pattern to pass data back from winform to parent program one-way

Design pattern to pass data back from winform to parent program one-way

I am refactoring another programmer's existing relativley complex VBA
project (i.e. "classic VB") and I would like to make it as robust and easy
to manage for future revisions. I am relativley new to design patterns,
but want to include some to help structure the code.
The program features a "start-up" dialog with configuration options (e.g.
radio buttons, checkboxes etc.) and a "Go" button and then does some
processing based on the selections made.
I would like to be able to design the code in such a way that when the
"Go" button is clicked it passes the configuration options back to the
program through a class interface such that I can change the look of the
dialog (e.g. add more checkboxes etc.) but not have to change the
interface. Even better would be to be able pass back an object/class
instance through the interface.
I have had a look around, and am not sure of a pattern that could be used
for this (maybe proxy?). I did have a look at MVC, but it seems a bit of
overkill for one form that is "one-directional" in that I don't need to
update the form after the button is clicked.
Does anyone have any ideas on ways that they would go about it?

No comments:

Post a Comment