C# Remotable Object

Any object outside the application domain of the caller application should be considered as Remote Object . A Remote Object that should be derived from MarshalByRefObject Class. Any object can be changed into a Remote Object by deriving it from MarshalByRefObject . Objects without inheriting from MarshalByRefObject are called Non-remotable Objects.

The following example creating a Remote Object in C#, RemoteTime , which send the current time to the Client Application using Remoting Framework. The RemoteTime class is derived from MarshalByRefObject and inside the class it has a method getTime() which returns the current time from the Remote Object.

Không có nhận xét nào:

Đăng nhận xét