----------------------------------------------------
----------------------------------------------------
6) What is the name given to a type of assembly which contains localized resources?
Ans)
Select from following answers:
A. a) Satellite
B. b)Spoke
C. c)Sputnik
D. d)Hub
satellite
We can deploy our application's resources in satellite assemblies. Generally by definition, satellite assemblies contains only resource files. They do not contain any application code.
In the satellite assembly deployment model, we create an application with one default assembly (which is the main assembly) and several satellite assemblies.
-------------------------------------------------------------------
7) In Singleton Pattern, how will you make sure that threading is done with minimal overhead
Ans)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
public sealed class Singleton
{
private static volatile Singleton instance;
private static object syncRoot = new Object();
private Singleton() {}
public static Singleton Instance
{
get
{
if (instance == null)
{
lock (syncRoot)
{
if (instance == null)
instance = new Singleton();
}
}
return instance;
}
}
}
'''''''''''''''''''''''''''''''''''''''''''''''''''''
In the above code, when the Singleton instance is created for the first time then it is locked and synchronized but next call or successive calls make sure that the lock is not checked anymore because an instance already exists. This way the overhead of checking the lock minimizes.
The double-check locking approach solves the thread concurrency problems while avoiding an exclusive lock in every call to the Instance property method.
6) What is the name given to a type of assembly which contains localized resources?
Ans)
Select from following answers:
A. a) Satellite
B. b)Spoke
C. c)Sputnik
D. d)Hub
satellite
We can deploy our application's resources in satellite assemblies. Generally by definition, satellite assemblies contains only resource files. They do not contain any application code.
In the satellite assembly deployment model, we create an application with one default assembly (which is the main assembly) and several satellite assemblies.
-------------------------------------------------------------------
7) In Singleton Pattern, how will you make sure that threading is done with minimal overhead
Ans)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
public sealed class Singleton
{
private static volatile Singleton instance;
private static object syncRoot = new Object();
private Singleton() {}
public static Singleton Instance
{
get
{
if (instance == null)
{
lock (syncRoot)
{
if (instance == null)
instance = new Singleton();
}
}
return instance;
}
}
}
'''''''''''''''''''''''''''''''''''''''''''''''''''''
In the above code, when the Singleton instance is created for the first time then it is locked and synchronized but next call or successive calls make sure that the lock is not checked anymore because an instance already exists. This way the overhead of checking the lock minimizes.
The double-check locking approach solves the thread concurrency problems while avoiding an exclusive lock in every call to the Instance property method.