Connexions

Sections
You are here: Home » Content » Union Design Pattern: Inheritance and Polymorphism

About: Union Design Pattern: Inheritance and Polymorphism

Module by: Stephen Wong, Dung Nguyen. E-mail the authors

View content

Metadata

Name: Union Design Pattern: Inheritance and Polymorphism
ID: m11796
Language:
Summary: The union design pattern is a structural pattern that depicts the inheritance relationship between a superclass and its subclasses. The superclass is an abstract representation of the union of all the subclasses. Due to this polymorphism, the subclasses can thus be used wherever the superclass is required.
Subject: Science and Technology
Keywords: design patterns, OOP, object oriented programming, polymorphism, inheritance
Document Type: -//CNX//DTD CNXML 0.5//EN
License: Creative Commons Attribution License CC-BY 1.0

Authors: Stephen Wong (swong@rice.edu), Dung Nguyen (dxnguyen@rice.edu)
Copyright Holders: Stephen Wong (swong@rice.edu), Dung Nguyen (dxnguyen@rice.edu)
Maintainers: Stephen Wong (swong@rice.edu), Dung Nguyen (dxnguyen@rice.edu)

Latest version: 1.11 (history)
First publication date: Jan 20, 2004 10:46 am US/Central
Last revision to module: Jan 30, 2008 11:39 pm US/Central

Module XML: m11796_1.11.cnxml

Version History

Version: 1.11 Jan 30, 2008 11:39 pm US/Central by Stephen Wong
Changes:
Fixed missing colspec in second table

Version: 1.10 Jul 2, 2007 6:32 pm GMT-5 by Stephen Wong
Changes:
Added middle section on problems with hoisting.

Version: 1.9 May 29, 2004 10:59 am GMT-5 by Stephen Wong
Changes:
Fix formatting problem

Version: 1.8 May 29, 2004 10:54 am GMT-5 by Stephen Wong
Changes:
Clarified Prob. 10

Version: 1.7 May 29, 2004 10:47 am GMT-5 by Stephen Wong
Changes:
Fixed type in Prob. #8 and clarified Prob. #11.

Version: 1.6 Jan 30, 2004 2:25 am US/Central by Stephen Wong
Changes:
added more examples

Version: 1.5 Jan 28, 2004 2:52 pm US/Central by Stephen Wong
Changes:
fixed typo in code

Version: 1.4 Jan 27, 2004 12:40 pm US/Central by Stephen Wong
Changes:
Added exercises on polymorphism

Version: 1.3 Jan 25, 2004 11:16 pm US/Central by Stephen Wong
Changes:
Added comment on interfaces

Version: 1.2 Jan 21, 2004 9:47 am US/Central by Stephen Wong
Changes:
added material on variant/invariant

Version: 1.1 Jan 20, 2004 11:06 pm US/Central by Stephen Wong
Changes:
initial publication

How to Reuse and Attribute This Content

If you derive a copy of this content using a Connexions account and publish your version, proper attribution of the original work will be automatically done for you.

If you reuse this work elsewhere, in order to comply with the attribution requirements of the license (CC-BY 1.0), you must include

  • the authors' names: Stephen Wong, Dung Nguyen
  • the title of the work: Union Design Pattern: Inheritance and Polymorphism
  • the Connexions URL where the work can be found: http://cnx.org/content/m11796/1.11/

See the citation section below for examples you can copy.

How to Cite and Attribute This Content

The following citation styles comply with the attribution requirements for the license (CC-BY 1.0) of this work:

American Chemical Society (ACS) Style Guide:

Wong, S.; Nguyen, D. Union Design Pattern: Inheritance and Polymorphism, Connexions Web site. http://cnx.org/content/m11796/1.11/, Jan 30, 2008.

American Medical Assocation (AMA) Manual of Style:

Wong S, Nguyen D. Union Design Pattern: Inheritance and Polymorphism [Connexions Web site]. January 30, 2008. Available at: http://cnx.org/content/m11796/1.11/.

American Psychological Assocation (APA) Publication Manual:

Wong, S., & Nguyen, D. (2008, January 30). Union Design Pattern: Inheritance and Polymorphism. Retrieved from the Connexions Web site: http://cnx.org/content/m11796/1.11/

Chicago Manual of Style (Bibliography):

Wong, Stephen, and Dung Nguyen. "Union Design Pattern: Inheritance and Polymorphism." Connexions. January 30, 2008. http://cnx.org/content/m11796/1.11/.

Chicago Manual of Style (Note):

Stephen Wong and Dung Nguyen, "Union Design Pattern: Inheritance and Polymorphism," Connexions, January 30, 2008, http://cnx.org/content/m11796/1.11/.

Chicago Manual of Style (Reference, in Author-Date style):

Wong, S., & Nguyen, D. 2008. Union Design Pattern: Inheritance and Polymorphism. Connexions, January 30, 2008. http://cnx.org/content/m11796/1.11/.

Modern Languages Association (MLA) Style Manual:

Wong, Stephen, and Dung Nguyen. Union Design Pattern: Inheritance and Polymorphism. Connexions. 30 Jan. 2008 <http://cnx.org/content/m11796/1.11/>.