assembly.GetTypes() vs assembly.DefinedTypes.Select(t => t.AsType());
public static IEnumerable<Type> GetAccessibleTypes(this Assembly assembly) { try { #if NET40 return assembly.GetTypes(); #else return assembly.DefinedTypes.Select(t => t.AsType()); #endif } catch (ReflectionTypeLoadException ex) { // The exception is thrown if some types cannot be loaded in partial trust. // For our purposes we just want to get the types that are loaded, which are // […]
assembly.GetTypes() vs assembly.DefinedTypes.Select(t => t.AsType());
public static IEnumerable<Type> GetAccessibleTypes(this Assembly assembly) { try { #if NET40 return assembly.GetTypes(); #else return assembly.DefinedTypes.Select(t => t.AsType()); #endif } catch (ReflectionTypeLoadException ex) { // The exception is thrown if some types cannot be loaded in partial trust. // For our purposes we just want to get the types that are loaded, which are // […]
assembly.GetTypes() vs assembly.DefinedTypes.Select(t => t.AsType());
public static IEnumerable<Type> GetAccessibleTypes(this Assembly assembly) { try { #if NET40 return assembly.GetTypes(); #else return assembly.DefinedTypes.Select(t => t.AsType()); #endif } catch (ReflectionTypeLoadException ex) { // The exception is thrown if some types cannot be loaded in partial trust. // For our purposes we just want to get the types that are loaded, which are // […]
assembly.GetTypes() vs assembly.DefinedTypes.Select(t => t.AsType());
public static IEnumerable<Type> GetAccessibleTypes(this Assembly assembly) { try { #if NET40 return assembly.GetTypes(); #else return assembly.DefinedTypes.Select(t => t.AsType()); #endif } catch (ReflectionTypeLoadException ex) { // The exception is thrown if some types cannot be loaded in partial trust. // For our purposes we just want to get the types that are loaded, which are // […]
Debugging xml and annotations
By now, most web containers have an annotation variant of their xml configurations for Java EE. I’m guessing this is because it’s better to keep things in Java where they can be managed, coded with and controlled. The problem, however, still remains that with annotations you cannot efficiently debug and diagnose an issue because when an exception is thrown it doesn’t give you the full stack but instead, just the head.
Debugging xml and annotations
By now, most web containers have an annotation variant of their xml configurations for Java EE. I’m guessing this is because it’s better to keep things in Java where they can be managed, coded with and controlled. The problem, however, still remains that with annotations you cannot efficiently debug and diagnose an issue because when an exception is thrown it doesn’t give you the full stack but instead, just the head.
Using reflection vs creating a new class
I and a friend are having an argument on what is the better technique to use in the following scenario:
C# static practices coming from dynamic background
I have been dappling in C# after coming from several years in PHP.
I don’t find the language particularly difficult, although there are considerably more constructs for me to get used to.
C# static practices coming from dynamic background
I have been dappling in C# after coming from several years in PHP.
I don’t find the language particularly difficult, although there are considerably more constructs for me to get used to.
Reflection performance in this iteration of a (probably) large excel file
I’m wondering the performance of reflection in this situation. I’m iterating a (probably) large excel file (let’s say 3000 max) which it’s going to be done from time to time, and the implementation that my mate is something like this, iterating each row: