| 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 |
|
|
|
| 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) |
|
|
|
| Version: | 1.11 (history) |
| Created: | Jan 20, 2004 10:46 am US/Central |
| Revised: | Jan 30, 2008 11:39 pm US/Central |
| 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 |
Choose the citation style appropriate to your needs:
Wong, S.; Nguyen, D. Union Design Pattern: Inheritance and Polymorphism, Connexions Web site. http://cnx.org/content/m11796/1.11/, Jan 30, 2008.
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/.
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/
Wong, Stephen, and Dung Nguyen. "Union Design Pattern: Inheritance and Polymorphism." Connexions. January 30, 2008. http://cnx.org/content/m11796/1.11/.
Stephen Wong and Dung Nguyen, "Union Design Pattern: Inheritance and Polymorphism," Connexions, January 30, 2008, http://cnx.org/content/m11796/1.11/.
Wong, S., & Nguyen, D. 2008. Union Design Pattern: Inheritance and Polymorphism. Connexions, January 30, 2008. http://cnx.org/content/m11796/1.11/.
Wong, Stephen, and Dung Nguyen. Union Design Pattern: Inheritance and Polymorphism. Connexions. 30 Jan. 2008 <http://cnx.org/content/m11796/1.11/>.