|
From: Michael Y. <yo...@gm...> - 2006-06-27 02:05:27
|
>Then again, injecting a static field is simpler and more efficient, >and I don't have to worry about looking up my container upon >deserialization. By "injecting a static field" are you saying injecting the singleton into a class variable? Though I cannot seem to put my finger on exactly why....right off hand something about that idea doesn't seem right. If you want to do that why not just create a "setSingletonInstance" non static method that sets your static "SingletonInstance" class variable? Though there would be the security concern of providing access to a non final class variable. Mike |