This is called a singleton design pattern.  You would have a static
getInstance method that returns a static instance of the class:


private static shoes myShoes;

Public shoes getInstance(){
        if(myShoes == null)
                myShoes = new shoes();
        return myShoes;
}


There mare slightly more sophisticated examples out there just search on
singleton and the language of your choice.  If you need a better example I
can dig one up just let me know but it will be in java, c++, or C#  I DON"T
DO VB.  LOL


Travis D. Falls | Consultant   RAFT.Net   IT | 860.547.4070 |
[EMAIL PROTECTED]


-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] Behalf Of Zed Burton
Sent: Friday, June 17, 2005 10:30 AM
To: [email protected]
Subject: [AspNetAnyQuestionIsOk] how to check if an instance exists


I create an instance of  Class XZY in several places.  If it is
already created I dont want to create another one.  How do I check
this?  I saw it done in a book somewhere but cant remember




 
Yahoo! Groups Links



 



*************************************************************************
PRIVILEGED AND CONFIDENTIAL: This communication, including attachments, is
for the exclusive use of addressee and may contain proprietary,
confidential and/or privileged information.  If you are not the intended
recipient, any use, copying, disclosure, dissemination or distribution is
strictly prohibited.  If you are not the intended recipient, please notify
the sender immediately by return e-mail, delete this communication and
destroy all copies.
*************************************************************************



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to