Click here to Skip to main content
15,926,857 members
Home / Discussions / C#
   

C#

 
AnswerRe: Condensing Constructer Code... Pin
S. Senthil Kumar20-Feb-06 7:55
S. Senthil Kumar20-Feb-06 7:55 
GeneralRe: Condensing Constructer Code... Pin
#coder0521-Feb-06 11:52
#coder0521-Feb-06 11:52 
QuestionVideo Player codec, whats next? Pin
ChevyVanDude20-Feb-06 6:29
ChevyVanDude20-Feb-06 6:29 
QuestionMoron of the day award... Pin
Ravi Bhavnani20-Feb-06 6:09
professionalRavi Bhavnani20-Feb-06 6:09 
AnswerSolution Pin
Ravi Bhavnani20-Feb-06 6:22
professionalRavi Bhavnani20-Feb-06 6:22 
AnswerRe: Moron of the day award... Pin
malharone20-Feb-06 6:23
malharone20-Feb-06 6:23 
GeneralRe: Moron of the day award... Pin
Ravi Bhavnani20-Feb-06 6:29
professionalRavi Bhavnani20-Feb-06 6:29 
AnswerRe: Moron of the day award... Pin
leppie20-Feb-06 10:53
leppie20-Feb-06 10:53 
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 

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.