commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Lambrou <m...@chrislambrou.com>
Subject Re: AW: AW: [proposal] avoiding jar version nightmares
Date Tue, 21 Dec 2004 04:23:02 GMT
Matt Sgarlata wrote:

> Does this mean .NET doesn't have reflection?  That's such a killer 
> feature of Java; I can't believe they wouldn't have ported it to .NET. 
> Any .NET developers out there that can tell us how .NET deals with 
> reflection when you have multiple versions of the same class?

Since the class name alone is insufficient to fully identify a specific 
version of a class, to my knowledge there is no equivalent to 
Class.forName(String classname) in .NET. Instead, .NET has the Assembly 
class. An Assembly is roughly akin to a java jar file, and is typically 
a single DLL that contains one or more classes. Assembly has a 
non-static getType(String typeName) method, that performs the same job 
as the static Class.forName(String classname) method in java, but for a 
specific Assembly instance. There is never any ambiguity over which 
version of the named Type that is returned, since an Assembly can only 
contain one version of any given class. Support for multiple versions of 
a class at runtime is achieved by storing those multiple class versions 
in separate Assemblies.

Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message