J
Jason Cavett
I am somewhat stumped on how to implement a component into my
application. Basically, I already have a ConfigurationFile object
that I read in from a file when my application starts and write out to
when my application closes. I can also update that ConfigurationFile
object from an options dialog.
The issue I'm having is that I'm not sure (from a design perspective)
the best way to update the various components that are affected when
the ConfigurationFile changes. I have three problems/questions:
1. I want the system to be updated (relatively) immediately after the
changes are applied.
2. I considered using the Observable pattern to do this, but it seems
rather clunky because there are quite a few components in the system
that would need to observe the ConfigurationFile. I'm not even sure I
like the ConfigurationFile being an Observable object in the first
place. Do you think this is a good idea?
3. Would it be beneficial to make the ConfigurationFile a Singleton in
this sort of situation?
This is the first time I've ever run across "global options" like
this, so I hope my questions make sense.
Thanks
application. Basically, I already have a ConfigurationFile object
that I read in from a file when my application starts and write out to
when my application closes. I can also update that ConfigurationFile
object from an options dialog.
The issue I'm having is that I'm not sure (from a design perspective)
the best way to update the various components that are affected when
the ConfigurationFile changes. I have three problems/questions:
1. I want the system to be updated (relatively) immediately after the
changes are applied.
2. I considered using the Observable pattern to do this, but it seems
rather clunky because there are quite a few components in the system
that would need to observe the ConfigurationFile. I'm not even sure I
like the ConfigurationFile being an Observable object in the first
place. Do you think this is a good idea?
3. Would it be beneficial to make the ConfigurationFile a Singleton in
this sort of situation?
This is the first time I've ever run across "global options" like
this, so I hope my questions make sense.
Thanks