Ferret: Programming language support for multiple dynamic classification
Abstract
We introduce a concept of multiple dynamic classification, a powerful generalization of single-inheritance OO, and a language Ferret which implements it. Multiple classification allows Male, Female, and Married to be subclasses of Person, arranged so that a single Person object may be both Male and Married, but may not be both Male and Female. Dynamic classification allows classes to change: a Person may acquire or lose Married status. The subclasses are true subclasses. Married carries fields (e.g., spouse) which are specific to married people. Methods may be defined on classes, and even on Boolean combinations of class: Male & Married. Ferret provides a generalization of superclass calls, so that the methods for Male & Married can be based on those for Male and Married, without losing other classifications like Employee. Ferret has mutators, analogous to constructors but applicable when objects change class. The resulting language is powerful and highly expressive. © 2008 Elsevier Ltd. All rights reserved.