471,305 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,305 software developers and data experts.

UIP and Multiple Instances of Controller Class

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
Jul 21 '05 #1
0 953

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by SilverShadow | last post: by
10 posts views Thread by simon.hibbs | last post: by
3 posts views Thread by dice | last post: by
3 posts views Thread by =?Utf-8?B?VG9kZA==?= | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.