[Springnet-developer] Object creation invoking protected constructors?
Brought to you by:
aseovic,
markpollack
|
From: Erich E. <E.E...@di...> - 2007-09-09 10:36:39
|
Steinar on the forum asked this here: = http://forum.springframework.net/showthread.php?t=3D3448 =20 I'd like to revisit the design decision to not allow accessing = non-public types/constructors/methods/properties and hear your opinions = on this. =20 I recently ran into this issue myself when trying to provide a DI = capable wrapper for "System.Web.UI.SimpleHandlerFactory" from System.Web = assembly. This type is internal and can't be instantiated using Spring = which required to implement a (non-trivial) workaround. The easy way = would be to remove the restriction to public types. =20 I know of opinions out there to don't enforce any restrictions within = the framework. Developers should know what they are doing and if someone = wants to instantiate a non-public type, let him do it at his own risk. =20 Other opinions? =20 cheers, Erich =20 |