User FAQs

If you have a question, please send it to us.


1) What is an Assembly ?
In .NET an assembly is a partially compiled code library used in deployment.
There are two types: process assemblies (exe) and library asemblies (dll).


2) What is an Application Domain ?
An application domain provides a flexible and secure method of isolating running .NET applications.
Before a .NET assembly can be executed it must be loaded into an application domain.
Errors in one application domain cannot affect code running in any other application domains.


3) What is a Namespace ?
A namespace provides a way of organising and grouping your classes.


4) What is Reflection ?
This is a technique that allows you to fetch type (assembly) information at runtime programmatically. You can also achieve late binding using Reflection.
This allows you to examine or modify the meta data from assemblies at runtime.
This is useful for:
Viewing metadata -
Type discovery - examine the types in other assemblies
Late binding - based on Type discovery
Creating new types at runtime (Reflection Emit) Creating custom classes at runtime which will run significantly faster than a more generic class created at compile time


Reflection can be used to adapt a program execution at run-time
This is the process by which a program can read its own meta-data
A program is said to reflect on itself extracting metadata from its assembly and using that metadata to either inform the user or modify its behaviour


5) If you pass an object into a method and you want to find out what type it is - how can you do this ?
Declare the members you need in a class or interface and cast to that using Reflection.

public static T Cast<T>(object obj) 
{
   return (T)obj;
}

This method can then be invoked using Reflection.

methodInfo castMethod = this.GetType().GetMethod("Cast").MakeGenericMethod(t) : 
object castedobject = castmethod.Invoke(null, new object[] {obj});


© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext