I'm refactoring a solution for a project of which an original exists as a VB script application and a new version was started in C#. It will be a form with a TabControl. One tab is a ListView in which lists of hostnames are imported and then processed. When I took the project over all of the code for importing and processing was in the MainForm class. I've been going through all of the code and trying to seperate out the View and Controller sections. So now I have a HostnameController class and then MainForm class, which is the View.
How much information should the view know about the controller? If a user clicks the "Import Hostnames" button, should the button click handler have one line of code that calls a function on the controller, or should the form not even know about the button click causing the controller to subscribe to the button click event itself? Should the controller care that the hostnames are displayed in a ListView? Right now the hostames are loaded directly from a file to the ListView, and the loading code still resides in the MainForm class. When I move the importing code into the HostnameController(or a new HostnameImporter) class, then should the importing code load the hostnames into a more generic container? Then maybe I could bind the ListView to the generic container? TIA =================================== This list is hosted by DevelopMentor� http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
