|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
A question of designI have struggled with this question for many years and have so far not come up with what I consider a good answer. Consider one is designing a windows forms based application using vb.net. The main form of the application has a number of sets of controls that provide the GUI for particular application functions. One can design a class hierarchy that reflects the functions of the various sets of controls and hides the logic of the processing from the rest of the application. To achieve this the main form either has to intercept and pass-off events to the various objects encapsulating the logic of the controls or pass references to the controls to the classes and let them handle the events directly. I find both of these methods create too tight a dependency between the main form and the logic of each control set. Is there a better way? Is there a way to continue using the forms' editor to create the layout of the form and have the controls encapsulated in the processing classes? Any suggestions or pointers to reading materials would be much appreciated, Sid. "Sid Price" <s**@nowhere.com> wrote in How about UserControls or Plug Ins?news:#FJJQuY4GHA.2264@TK2MSFTNGP02.phx.gbl: > I find both of these methods create too tight a dependency between the > main form and the logic of each control set. Is there a better way? Is > there a way to continue using the forms' editor to create the layout > of the form and have the controls encapsulated in the processing > classes? I'm currently using CabUI which is pre-packaged combination of both and it works well. "Spam Catcher" <spamhoneypot@rogers.com> wrote in message I see a similar issue with a User Control although to a lesser extent.news:Xns984A8D5267C78usenethoneypotrogers@127.0.0.1... > "Sid Price" <s**@nowhere.com> wrote in > news:#FJJQuY4GHA.2264@TK2MSFTNGP02.phx.gbl: > How about UserControls or Plug Ins? Not sure I understand how a plug in would help; would you care to expand on that? > I googled CabUI and found nothing, what is it?> I'm currently using CabUI which is pre-packaged combination of both and it > works well. > Thanks again, Sid. "Sid Price" <s**@nowhere.com> wrote in With plugins you can dynamically add/remove services/controls as needed.news:eJGOEga4GHA.2264@TK2MSFTNGP06.phx.gbl: > Not sure I understand how a plug in would help; would you care to > expand on that? A event broker of sorts could solve the need to pass references around - you would register each plugin with the event broker with the events it needs to be notified about. >> I'm currently using CabUI which is pre-packaged combination of both Take a look at Composite UI from microsoft practices:>> and it works well. >> > > I googled CabUI and found nothing, what is it? > practices.gotdotnet.com/projects/cab CAB UI has all the plugin loading, event broker, layout engine, etc stuff all built. You just provide the main form + individual plugins. I really appreciate you taking the time to help out; however the component
you suggested is for .NET 2005 and Framework 2.0 and I am using 2003 and Framework 1.1 at this time. Also the URL given is incorrect, the URL direct to MS is http://www.microsoft.com/downloads/details.aspx?FamilyID=b619276a-2e9e-47c6-8893-f8e5f88fd8dd&DisplayLang=en Any other suggestions would be much appreciated, Sid. Show quoteHide quote "Spam Catcher" <spamhoneypot@rogers.com> wrote in message news:Xns984AA94EB2663usenethoneypotrogers@127.0.0.1... > "Sid Price" <s**@nowhere.com> wrote in > news:eJGOEga4GHA.2264@TK2MSFTNGP06.phx.gbl: > >> Not sure I understand how a plug in would help; would you care to >> expand on that? > > With plugins you can dynamically add/remove services/controls as needed. > > A event broker of sorts could solve the need to pass references around - > you would register each plugin with the event broker with the events it > needs to be notified about. > >>> I'm currently using CabUI which is pre-packaged combination of both >>> and it works well. >>> >> >> I googled CabUI and found nothing, what is it? >> > > Take a look at Composite UI from microsoft practices: > > practices.gotdotnet.com/projects/cab > > CAB UI has all the plugin loading, event broker, layout engine, etc stuff > all built. You just provide the main form + individual plugins. "Sid Price" <s**@nowhere.com> wrote in
http://practices.gotdotnet.com/projects/cab is the correct URL ... it's the news:ewvC8Sb4GHA.512@TK2MSFTNGP06.phx.gbl: > I really appreciate you taking the time to help out; however the > component you suggested is for .NET 2005 and Framework 2.0 and I am > using 2003 and Framework 1.1 at this time. > > Also the URL given is incorrect, the URL direct to MS is > http://www.microsoft.com/downloads/details.aspx?FamilyID=b619276a-2e9e- > 47c6-8893-f8e5f88fd8dd&DisplayLang=en > team URL. Yes, the framework is for 2.0 - but it might give you some ideas for 1.1. Another possiblity is to build your app using a set of distributed service (remoting or web service) - your winform app will connect to individual services as needed to fetch data. Hello Sid,
How about creating properties (of type delegate) so that you can push data out (instead of the usual pull model). Something like.. in the business class: public delegate UpdateStatusDelegate(byval tStatus as string) public property UpdateStatus as UpdateStatusDelegate get.. end get.. set.. end set end property then in your form.. wire up the property to your updater method.. private sub DoStatusUpdate(byval tStatus as string) oTxtStatus.Text = tstatus end sub sub form_load () Dim tSomeBusnessObj as BusinessClass = New BusinessClass tSomeBusinessObj.UpdateStatus = New BusinessClass.UpdateStatusDelegate(Me.DoStatusUpdate) end sub as for the busness objects pulling from the UI.. well.. that's just not done. ever. -Boo Show quoteHide quote > Hello, > > I have struggled with this question for many years and have so far not > come up with what I consider a good answer. Consider one is designing > a windows forms based application using vb.net. The main form of the > application has a number of sets of controls that provide the GUI for > particular application functions. One can design a class hierarchy > that reflects the functions of the various sets of controls and hides > the logic of the processing from the rest of the application. To > achieve this the main form either has to intercept and pass-off events > to the various objects encapsulating the logic of the controls or pass > references to the controls to the classes and let them handle the > events directly. > > I find both of these methods create too tight a dependency between the > main form and the logic of each control set. Is there a better way? Is > there a way to continue using the forms' editor to create the layout > of the form and have the controls encapsulated in the processing > classes? > > Any suggestions or pointers to reading materials would be much > appreciated, Sid. >
Securing my app with serial number
Encrypt a date to use in demo version System.Diagnostics.Process.Start Freezes Problem with mutex No Recursive instr?!! Do I need to install Excel on the server? RTf to Word.Doc Visual Studio Proffessional 2005 Finding embedded controls? C# to VB Conversion Help - Overriding Events? |
|||||||||||||||||||||||