What is NameSpace?
Namespace has two basic functionality:-
• NameSpace Logically group types, example System.Web.UI logically groups UI
related features.
• In Object Oriented world, many times it is possible that programmers will use the
same class name. Qualifying NameSpace with class name can avoid this collision.
If you want to view an Assembly how do you go about it?
Twist: What is ILDASM?
When it comes to understanding of internals, nothing can beat ILDASM. ILDASM converts the
whole ‘exe’ or ‘dll’ in to IL code. To run ILDASM you have to go to ‘C:\Program
Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin’. Note that we had v1.1 you have to
probably change it depending on the type of framework version you have.
If you run IDASM.EXE from the path you will be popped with the IDASM exe program as
shown in figure ILDASM. Click on file and browse to the respective directory for the DLL whose
assembly you want to view. After you select the DLL you will be popped with a tree view details
of the DLL as shown in figure ILDASM. On double clicking on manifest, you will be able to
view details of assembly, internal IL code etc as shown in Figure Abvoe ‘Manifest View’.
What is Manifest?
Assembly metadata is stored in Manifest. Manifest contains all the metadata needed to do the
following things (See Figure Manifest View for more details):
• Version of assembly.
• Security identity.
• Scope of the assembly.
• Resolve references to resources and classes.
The assembly manifest can be stored in a PE file either (an .exe or) .dll with Microsoft
intermediate language (MSIL code with Microsoft intermediate language (MSIL) code or in a
stand-alone PE file, that contains only assembly manifest information.
What is GAC?
Twist: In what situations will you register .NET assembly in GAC?
GAC (Global Assembly Cache) is where all shared .NET assembly reside. GAC is used in the
following situations:-
• If the application has to be shared among several application.
• If the assembly has some special security, requirements like only administrators can
remove the assembly. If the assembly is private then a simple delete of assembly
the assembly file will remove the assembly.
What is COM?
Microsoft’s COM is a technology for component software development. It is a binary standard,
which is language independent. DCOM is a distributed extension of COM.
What is Reference counting in COM?
Reference counting is a memory management technique used to count how many times an object
has a pointer referring to it. The first time it is created, the reference count is set to one. When the
last reference to the object is nulled, the reference count is set to zero and the object is deleted.
Care must be exercised to prevent a context switch from changing the reference count at the time
of deletion. In the methods that follow, the syntax is shortened to keep the scope of the discussion
brief and manageable.
Can you describe IUKNOWN interface in short?
Every COM object supports at least one interface, the IUnknown interface. All interfaces are
classes derived from the base class IUnknown. Each interface supports methods access data and
perform operations transparently to the programmer. For example, IUnknown supports three
methods, AddRef, Release(), and QueryInterface(). Suppose that pinterf is a pointer to an
IUnknown. pinterf->AddRef() increments the reference count. pinterf->Release() decrements the
reference count, deleting the object when the reference count reaches zero. pinterf-
>QueryInterface (IDesired, pDesired) checks to see if the current interface (IUnknown) supports
another interface, IDesired, creates an instance (via a call to CoCreateInstance ()) of the object if
the reference count is zero (the object does not yet exist), and then calls pDesired->AddRef () to
increment the reference count (where pDesired is a pointer to IDesired) and returns the pointer to
the caller.
Can you explain what DCOM is?
DCOM differs from COM in that it allows for creating objects distributed across a network, a
protocol for invoking that object’s methods, and secures access to the object. DCOM provides a
wrapper around COM, hence it is a backwards compatible extension. DCOM uses Remote
Procedural Calls (RPC) using Open Software Foundation’s Distributed Computing Environment.
These RPC are implemented over TCP/IP and named pipes. The protocol, which is actually being
used, is registered just prior to use, as opposed to being registered at initialization time. The
reason for this is that if a protocol is not being used, it will not be loaded.
Types of Transactions are there in COM + .NET5 transactions types can be used with COM+. Whenever an object is registered with COM+, it
has to abide either to these 5 transaction types.
Disabled: - There is no transaction. COM+ does not provide transaction support for this
component.
Not Supported: - Component does not support transactions. Hence even if the calling component
in the hierarchy is transaction enabled this component will not participate in the transaction.
Supported: - Components with transaction type support will be a part of the transaction. This
will be only if the calling component has an active transaction. If the calling component is not
transaction enabled this component will not start a new transaction.
Required: - Components with this attribute require a transaction i.e. either the calling should
have a transaction in place else, this component will start a new transaction.
Required New: - Components enabled with this transaction type always require a new
transaction. Components with required new transaction type instantiate a new transaction for
themselves every time.
Threading
What is Multi-tasking?
It is a feature of modern operating systems with which we can run multiple programs at same
time example Word, Excel etc.
What is Multi-threading?
Multi-threading forms subset of Multi-tasking. Instead of having to switch between programs,
this feature switches between different parts of the same program. Example you are writing in
word and at the same time word is doing a spell check in background.
What is a Thread?
A thread is the basic unit to which the operating system allocates processor time.
Did VB6 support multi-threading?
While VB6 supports multiple single-threaded apartments, it does not support a free-threading
model, which allows multiple threads to run against the same set of data.
we have multiple threads in one App domain?
One or more threads run in an AppDomain. An AppDomain is a runtime representation of a
logical process within a physical process. Each AppDomain is started with a single thread, but
can create additional threads from any of its threads.
No comments:
Post a Comment