Re: Help in design/threading

Matthew Wills <[email protected]> Mon, 29 Jul 2002 09:32:56 +1000
Newsgroups gmane.comp.windows.devel.vbcom
Message-ID <[email protected]>
Ali,

What you might be looking for is the Singleton pattern. I would suggest joining the list at http://peach.ease.lsoft.com/scripts/wa.exe?A0=visbas-l - the Singleton pattern has been discussed there many times before (search the archives).

Seeya
Matthew Wills @ Deutsche Asset Management
(w) (02) 9249 9366
(h) (02) 9586 3655
(m) 0416 235 016
(work email) [email protected]
(personal email) [email protected]




                      kheyrollahi@ALIOS
                      TAD.COM                  To:       [email protected]
                      Sent by:                 cc:
                      [email protected]        Subject:  [VBCOM] Help in design/threading
                      ELOP.COM


                      26/07/2002 19:22
                      Please respond to
                      VBCOM






Hi all,

I have got a problem in designing the lowermost layer. Actually since we
are going to deploy our software on windows 98, we cannot have the luxury
of connection sharing (Am I wrong?). And since we wouldn't have more than
4-5 computers on the network and all of them must be able to work stand-
alone in case a netwrok problem occurs or the master computer fails (and
our clients usually do not have even the slightest knowledge of
computer), we have designed a pretty sohpisticated abstratction in terms
of connection management and fault tolerance which is done in our
Database layer so that business layer only receives data services and
doesn't know much about how it is done on on which connection (local
database vs. remote database). We have also placed merge replication
which solves inconsistencies of databases.

Now we want to create only one object of that class per machine (which
opens and holds on to two connections one to local database and one to
remote) and business layer tries to get the object if it is there and
create it if it is not there, so we wouldn't be opening a new connection
per each biz objects. How we could implement it:

1. Biz objects try to use GetObject(,"MyComponent.MyClass") which sadly
does not work for components written in VB.

2. Create our database component as single-threaded so that our clients
could share the object.

3.I couldn't think of anything else !:)
Thank you very much for your comments and suggestions, in advance.

Ali

You can read messages from the VBCOM archive, unsubscribe from VBCOM, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.




--

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

You can read messages from the VBCOM archive, unsubscribe from VBCOM, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.