× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I am creating a modification of the Singleton architecture.  I am only
permitting one of a specific object with specific attributes.  When I am
performing this function, I need to remove the object reference from a
hashmap when the object is destroyed by the user.  My question is this....
Should I place the code for removing the object reference from the hashmap
in the destroy() method, or the finalize() method?

My class is going to contain a static hashmap of objects with a key
reference object.  I am concerned that either the destroy() or finalize()
does not get called when a class is given a null reference.  I am thinking
that one of the methods will get used for the last instance of the class and
the other will be used for when each instance.

any insights?

Thanks

Mike






As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.