Views: 7.6K
Replies: 1
Archived
|
Protecting the "proxy" of a webServicehiya,
We're using a 3rd party webService, I don't want the webService proxy set anywhere other than in the constructor. I was thinking of creating a proxy class that simplycontains all the required properties...which will be set in theconstructor... I've been reading up on sealed modifiers and singletons..I waswondering if the proxy is a candiadate for this approach? Any advice appreciated. ta, yogi Chr Yoker, Nov 11, 2010
|
|
Reply 1Yogi:
Actually sealed modifiers, singletons, and constructors that initialize a series of private variables are all concepts that solve different problems. If you don't want others to access private variables then your constructor idea seems fine. If you don't want any other class to derive from your class, then the sealed modifier is fine. If you want just one instance of your class then the Singleton pattern works great. So, the answer to your question really depends on what the problem is you're trying to solve. Hope this helps. Dan McMillan, Dec 03, 2010
Thanks for your explanation.
Aug 31, 2010
|