JScript .NET, Part V: Polymorphism - Doc JavaScript
JScript .NET, Part V: Polymorphism
In this column we continue our series on JScript .NET. In Part I, we laid down the groundwork for JScript .NET, showing you how to install IIS and the .NET SDK, and how to compile and run a JScript .NET program. In Part II, we showed you the major differences between JavaScript and JScript .NET. In Part III, we focused on JScript .NET's classes and their division among namespaces. In Part IV we taught you how to use inheritance in classes and interfaces. In this column, we cover the third holy grail of object oriented programming: polymorphism.
After encapsulation and inheritance, polymorphism is considered one of the powerful concepts of object oriented programming languages. The idea is to use the same method for different types of objects. In this column, we will delve into the benefits of this paradigm, and will show you how to implement it with real scripts. We'll show you how the .NET framework uses this concept, and how you can program polymorphic methods yourself. We'll explain how to implement the methods behind the scenes that take care of the different object types. We'll cover both polymorphic classes as well as polymorphic interfaces.
In this column you will learn:
- How to use the Object type
- How to use derived objects with base members
- How to use the .NET framework polymorphic methods
- How to write a polymorphic utility function
- How to implement a polymorphic interface
- How to write multiple implementations of a polymorphic interface
Next: How to use the Object type
Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: June 3, 2002
Revised: June 3, 2002
URL: https://www.webreference.com/js/column111/index.html