Remoting - Interview Questions

Q : What is .NET Remoting?

Ans : .NET Remoting allows objects to interact with one another across application domains.

Q :What are the 2 message encoding formats supported by .NET Remoting and when do you choose one over the other? Message Encoding Formats:

Ans : 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.

Q : What are the two types of .NET remote objects?

Ans : 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.

Q : What is considered as Remote Object?

Ans : Any object outside the application domain of the calling appication is considered remote object, even if the objects are executing on the same machine.

Q : Can you treat every object as a remote object?

Ans : Objects that cannot be serialized cannot be passed to a different application domain and are therefore nonremotable.

Q : What are the ways in which an object can be serialized?

Ans : 1. Mark your class with serializable attribute.
2. Make your class implement ISerializable interface.

Q : How can you change an object into a remote object?

Ans : Any object can be changed into a remote object by deriving it from MarshalByRefObject.

Q : What happens when a client activates a remote object?

Ans : 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.

Q : What are proxy objects and what is the use of these proxy objects?

Ans : 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.

Leave a Reply
Name (required)
Email (will not be published) (required)
Web Site

List of Top Hospitals in India