Click here to Skip to main content
15,924,581 members
Home / Discussions / C#
   

C#

 
QuestionWeb service Pin
magnifique20-Feb-06 5:45
magnifique20-Feb-06 5:45 
QuestionNameValueCollection or HashTable Pin
student_rhr20-Feb-06 5:34
student_rhr20-Feb-06 5:34 
GeneralRe: NameValueCollection or HashTable Pin
Guffa20-Feb-06 7:04
Guffa20-Feb-06 7:04 
AnswerRe: NameValueCollection or HashTable Pin
NatLang20-Feb-06 9:12
NatLang20-Feb-06 9:12 
AnswerRe: NameValueCollection or HashTable Pin
leppie20-Feb-06 10:57
leppie20-Feb-06 10:57 
QuestionDesign Strategy Question Pin
gantww20-Feb-06 5:28
gantww20-Feb-06 5:28 
AnswerRe: Design Strategy Question Pin
Alvaro Mendez20-Feb-06 6:34
Alvaro Mendez20-Feb-06 6:34 
GeneralRe: Design Strategy Question Pin
gantww20-Feb-06 7:35
gantww20-Feb-06 7:35 
It is imperative to keep everything synchronized, but it may be possible in many cases for me to get away with simple refreshes when the focus changes. However, there are some cases when there may be sidebars or toolbars out that are accessing the same information. They may not get focus, but they still need to be updated to keep the user interface current. If I can make sure both views are actually pointing to the same object, keeping them in sync can easily be done via simple events.

I guess the real issue is figuring out some way to manage the lifecycle of the objects. It would be pretty easy to keep a running list of objects that I have instantiated (since I'm using a factory pattern) and simply return a reference to them if a similar request is made. I could possibly keep the reference to the view that requested them as well. When the object being referenced by the view changes (or the view is disposed), it could inform the class factory that it no longer needs the object. If the object isn't being referenced elsewhere, then it can be released.

The other option would be for the business object itself to allow the registration of objects that are "interested" in it. The object would fire events when a view was added or removed. The individual views wouldn't care about these events, but the class factory for the object would use them to determine whether or not to release the reference to the object. I don't particularly care for this idea, since it puts some lifecycle management logic into the object itself, while the rest of it remains in the controller/factory class.

Any thoughts?
GeneralRe: Design Strategy Question Pin
Alvaro Mendez20-Feb-06 8:06
Alvaro Mendez20-Feb-06 8:06 
GeneralRe: Design Strategy Question Pin
gantww21-Feb-06 14:04
gantww21-Feb-06 14:04 
QuestionForm Close Pin
mostafa_h20-Feb-06 5:05
mostafa_h20-Feb-06 5:05 
AnswerRe: Form Close Pin
User 665820-Feb-06 5:09
User 665820-Feb-06 5:09 
GeneralRe: Form Close Pin
Judah Gabriel Himango20-Feb-06 5:12
sponsorJudah Gabriel Himango20-Feb-06 5:12 
GeneralRe: Form Close Pin
delphidab22-Feb-06 7:12
delphidab22-Feb-06 7:12 
AnswerRe: Form Close Pin
Alvaro Mendez20-Feb-06 7:39
Alvaro Mendez20-Feb-06 7:39 
GeneralRe: Form Close Pin
mostafa_h20-Feb-06 9:29
mostafa_h20-Feb-06 9:29 
GeneralRe: Form Close Pin
Alvaro Mendez20-Feb-06 10:02
Alvaro Mendez20-Feb-06 10:02 
GeneralRe: Form Close Pin
mostafa_h21-Feb-06 2:39
mostafa_h21-Feb-06 2:39 
QuestionTrying to create a Web-Like Menu Pin
Jettajon20-Feb-06 4:49
Jettajon20-Feb-06 4:49 
QuestionWhen we can convert STRUCT into CLASS ? Pin
Ariston Darmayuda20-Feb-06 4:44
Ariston Darmayuda20-Feb-06 4:44 
AnswerRe: When we can convert STRUCT into CLASS ? Pin
Judah Gabriel Himango20-Feb-06 4:49
sponsorJudah Gabriel Himango20-Feb-06 4:49 
QuestionDataGridView and ComboBox Pin
zaboboa20-Feb-06 4:10
zaboboa20-Feb-06 4:10 
AnswerRe: DataGridView and ComboBox Pin
USrinivas20-Feb-06 17:12
USrinivas20-Feb-06 17:12 
QuestionClose Button Pin
alee15.10.8820-Feb-06 3:46
alee15.10.8820-Feb-06 3:46 
AnswerRe: Close Button Pin
J4amieC20-Feb-06 4:37
J4amieC20-Feb-06 4:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.