Events and Delegates in Remoting Applications
<<Previous
Next
>>
By Nishant Kumar
Events are one of the members of the class. When any noteworthy
activity occurs in the application, an event is raised which sends out the
message to the other part of the application which handles the event. The event
can carry arguments that contain information about the event. The method which
handles the event must have the same signature as the event itself. Events are
commonly used in the applications with graphical user interface elements such
as buttons, textbox etc. An event is triggered when any action such as mouse
click occurred in the interface element. The event-based programming model can
be used in the non-GUI applications such as .NET Remoting application. An event
in remoting.net occurs when the state of the application changes.
A delegate acts like a strongly type function pointer.
Delegates can invoke the methods that they reference without making explicit
calls to those methods. It is type safe since it holds reference of only
those methods that match its signature. Unlike other classes, the delegate
class has a signature. Delegates are used to implement event programming model
in .NET application. Delegates enable the methods that listen for an event, to
be abstract.
Steps to implement delegate to listen for events in the remoting application
Define a delegate that wraps an event handler method to handle the event.
Implement a class that raises the event.
Implement class that handles the event.
Also read
The data adapter objects connect a command objects to a Dataset
object..............
This method executes the SelectCommand to fill the DataSet object with data from
the data source...........
The DataSet object is a disconnected storage. It is used for manipulation of
relational data.............
Visual Studio 2005 is the best development tool for building data-driven web
applications. As part of the Visual Studio 2005 suite of tools, Microsoft is
introducing a new tool called Visual Web Developer (VWD) that is designed to
work with the current and next generation of ASP.NET. VWD provides powerful new
features for the web developer.................
With ASP.NET 2.0, things have changed for the better. For security-related
functionalities, ASP.NET 2.0 introduces a wide range of new
controls..............
|