Relative Content

Tag Archive for reflection

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.