Friday, May 23, 2014

Remoting of C#.Net Interview Questions(9)

Remoting of C#.Net Interview Questions(9)





1.What is .NET Remoting?
A).NET Remoting allows objects to interact with one another across application domains.


2.What are the 2 message encoding formats supported by .NET Remoting and when do you choose one over the other? Message Encoding Formats?
A)1. Binary encoding.
2. XML encoding.
Applications can use binary encoding where performance is critical, or XML encoding where interoperability with other remoting frameworks is essential.

3.What are the two types of .NET remote objects?
A)1. Client-activated objects - Client-activated objects are under the control of a lease-based lifetime manager that ensures that the object is garbage collected when its lease expires.
2. Server-activated objects - In the case of server-activated objects, developers have a choice of selecting either a "single call" or "singleton" model. The lifetime of singletons are also controlled by lease-based lifetime.

4. What is considered as Remote Object?
A)Any object outside the application domain of the calling appication is considered remote object, even if the objects are executing on the same machine.

5.Can you treat every object as a remote object?
A)Objects that cannot be serialized cannot be passed to a different application domain and are therefore nonremotable.

6.What are the ways in which an object can be serialized?
A)1. Mark your class with serializable attribute.
2. Make your class implement ISerializable interface.

7.How can you change an object into a remote object?
A)Any object can be changed into a remote object by deriving it from MarshalByRefObject.

8.What happens when a client activates a remote object?
A)When a client activates a remote object, it receives a proxy to the remote object. All operations on this proxy are appropriately indirected to enable the remoting infrastructure to intercept and forward the calls appropriately.


9.What are proxy objects and what is the use of these proxy objects?
A)Proxy objects are created when a client activates a remote object. The proxy object acts as a representative of the remote object and ensures that all calls made on the proxy are forwarded to the correct remote object instance.

0 comments:

Post a Comment