Jump to content

Refresher/SDLC/Delegate and Polymorphism

From Wikiversity

Presentation

Abstract and Interface
Abstract and Interface
Delegate and Polymorphism
Construction - Part 4
Construction - Part 4
List of Topics
List of Topics
   
This presentation was made possible by Wikiversal/WikiverSuite, which is made possible by your donation. Thank you for your support.
This presentation was made possible by Wikiversal/WikiverSuite, which is made possible by your donation. Thank you for your support.
Construction - Part 4
Construction - Part 4
 Polymorphism or Delegate: method overloading or method passing
 
 Late binding: method looked up by name at run-time and exact behavior determined at run-time
 
 Early binding: method name and signature stored in the virtual method table (v-table) at compile time
 
 Polymorphism: objects from different types responding to calls by the same name, e.g. operator overloading for addition delegate (function pointers in C++): an object encapsulates reference to a method
 
 multicast delegate: a delegate that points to and eventually fires off several methods
 
 Delegate: a class -- usable if declared and instantiated
 
 Delegate use: passed around as a parameter, and invoked by the receiving object
 
 Delegate example 1: success = MyAddressProvider.HandleCampaign(WhatToDoWithAddresses)
 
 Delegate example 2: MyMenuItem.Click += new System.Windows.RoutedEventHandlerMyMenuItem_Click)