• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/5

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

5 Cards in this Set

  • Front
  • Back
  • 3rd side (hint)
Q1. What is the difference between AppDomain, Assembly, Process, and a Thread
Ans: An AppDomain is an isolation unit within a process. AppDomains can be created at runtime, loaded with code, and unloaded. Its an isolation boundary designed to make .NET apps more reliable.
An assembly holds one or more modules, which hold compiled chunks of code. You will typically see an assembly as an .EXE or a .DLL.
A process is an executing application (waaaay oversimplified).
A thread is an execution context. The operating system executes code within a thread. The operating system switches between threads, allowing each to execute in turn, thus giving the impression that multiple applications are running at the same time.
To put it all together (very simplified)...
A program is executed. A process is created by the operating system, and within its single thread it starts loading code to execute. In a .NET application, a single AppDomain is created by the CLR. The application's executing assembly (the .EXE) is loaded into this AppDomain and begins execution. The application can spawn new processes, create AppDomains, load other assemblies into these domains, and then create new Threads to execute code in any of these AppDomains.
One of the biggest advantage of CLR's JIT compiler is - it prevents overlapping of processes' virtual address space. For example, if process 1 is spawned and the CLR (MScorEE.dll) is managing the execution of a managed assembly (.exe or .dll) within that process, then the JIT compiler will make sure that the virtual address space allocated to this process will not collide or overlap with the other adjacent processes. Having this advantage, it is now possible to re-use the single process for more than one managed code execution! Each managed code execution will have its own AppDomain and more than AppDomains could be part of a single process. This is what used by IIS and SQL Server (single process, many AppDomains).
Basic
Q2. What is .NET Wrapper Class
Ans: Simple rule here. If the class in the third-party library is an instance class, make your wrapper an instance class; if the class in the third-party is a static class, make your wrapper a static class. The idea of wrapper classes is generally to mimic structure, but simply hide complexity/advanced/unwanted functionality.
The only exception of which I can think is the case that the third-party library is poorly designed, and an instance class should really exist as a static class. Of course, if you are wrapping the functionality at such a level that your wrapper function instantiates a new class, it should really be declare within a static class.
Design Pattern
Q3. What are different WCF Instance service behavior
Ans : Following are different ways by which you can create WCF instances:
1. Create a new WCF service instance on every WCF client method call.
2. Only one WCF service instance should be created for every WCF client session.
3. Only one global WCF service instance should be created for all WCF clients.
To meet the above scenarios, WCF has provided three ways by which you can control WCF service instances:
1. Per call
2. Per session
3. Single instance
When should you use per call, per session, and single mode?
Per call
• You want a stateless services.
• Your service holds intensive resources like connection objects and huge memory objects.
• Scalability is a prime requirement. You would like to have a scaled out architecture.
• Your WCF functions are called in a single threaded model.
Per session
• You want to maintain states between WCF calls.
• You a scaled up architecture.
• Light resource references.
Single
• You want share global data through your WCF service.
• Scalability is not a concern.
WCF
Q4. What is pooling, how it can be achieved in WCF
Ans: Pooling is a technique where resources are recycled to avoid expensive creation and release of resources. Once the resources are recycled and sent back to pool they lose all their state and identity and are ready to be used again.
In WCF, it can be implemented by creating the behavior Extensions, and adding the newly created behavior Extensions to service behavior. Then is service tag, add behaviorConfiguration name.
WCF
Q5. What are 4 type of different behaviors in WCF
Ans: There are 4 types of behaviors in WCF: Service , Endpoint, Operation and Contract
WCF