Hello,
We are building an application featuring a set of dockable windows/forms. The main form and each child window are implemented as View classes in the UIP 2.0 mechanism. All the views share a common controller class. It appears that as the application starts up, many instances of the controller class are created, maybe as many as two for each view. This seems to be the way the sample apps work as well.
Is there a reason for this? We have noticed that it is hard for a control on one view to activate an event which is being listened for on another view directly. The control can fire the ?run? event on its controller, but this doesn?t fire the ?run? event on the controller to which the other view is listening. We have gotten around this mostly by using State. We have the Run Button set a value in state and then have all the views listen for a state change event. This seems to be the method supported by the sample applications.
We have also gotten around this by declaring the Event static and referring to it via the class name rather than as a member of the MyController object. Here, even though there still appear to be many controller instances, at least there is only one event queue. Is this dangerous for some reason? Is there some impact on scalability? Or will it fail on a multi-CPU system?
It seems like we may want to go even further and declare the controller to be static. Why have so many instances of the same class floating around?
-- John
--
Message posted via http://www.dotnetmonster.com