 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Joe Bain Guest
|
Posted: Tue Jan 06, 2004 3:46 pm Post subject: Diary Manager |
|
|
I am fixing up a few places in my current program that I do not like to be
more OO. What I am currently fixing is our diary system, it allows users to
save exacly where they are in the program and send it along with a note to
themselves or another user.
I have made a interface IDiarySupport and a manager TDiaryManager. Each form
that can be diaried implements IDiarySupport. The DiaryManager has 4 methods
addDiary, registerDiarySupporter, unRegisterDiarySupporter, and gotoDiary.
The first 3 functions are easy, gotoDiary is where I am having the problem.
There are a number of forms in the program and they are created and
destroyed as needed. In the constructor I register it and unregister it in
the destructor. Here is the question: Who do I goto the diary when the form
has not been created and therefor not registered?
--
Joe Bain
IEG Inc.
|
|
| Back to top |
|
 |
Joe Bain Guest
|
Posted: Tue Jan 06, 2004 4:10 pm Post subject: Re: Diary Manager |
|
|
Should I make a DiaryViewer class and create an instance of it in each unit
that has a form that can be diaried? The DiaryViewer can be responsible for
creating and destroying the form when the user goes to a diary.
"Joe Bain" <jbain.nospam (AT) nospam (DOT) addonsystems.com> wrote
| Quote: | I am fixing up a few places in my current program that I do not like to be
more OO. What I am currently fixing is our diary system, it allows users
to
save exacly where they are in the program and send it along with a note to
themselves or another user.
I have made a interface IDiarySupport and a manager TDiaryManager. Each
form
that can be diaried implements IDiarySupport. The DiaryManager has 4
methods
addDiary, registerDiarySupporter, unRegisterDiarySupporter, and gotoDiary.
The first 3 functions are easy, gotoDiary is where I am having the
problem.
There are a number of forms in the program and they are created and
destroyed as needed. In the constructor I register it and unregister it in
the destructor. Here is the question: Who do I goto the diary when the
form
has not been created and therefor not registered?
--
Joe Bain
IEG Inc.
|
|
|
| Back to top |
|
 |
Marc Rohloff Guest
|
Posted: Tue Jan 06, 2004 4:44 pm Post subject: Re: Diary Manager |
|
|
Joe Bain wrote on Tue, 6 Jan 2004 09:46:26 -0600 ...
| Quote: | There are a number of forms in the program and they are created and
destroyed as needed. In the constructor I register it and unregister it in
the destructor. Here is the question: Who do I goto the diary when the form
has not been created and therefor not registered?
|
You could register the Form's class instead of an actual instance. When
the 'goto' method is called you could then check if an instance of the
reuired form is available and if not then create it automatically.
Marc Rohloff
marc rohloff at bigfoot dot com
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|