Binary methods are one of the challenges for designers of object-oriented programming languages. In this paper we discuss binary class methods (class methods that receive parameters of their own class type) as an alternative for typical uses of binary inst
Late-bound Pragmatical Class Methods
AXEL SCHMOLITZKY, MARK EVERED, J. LESLIE KEEDY, GISELA MENGER
Department of Computer Structures
University of Ulm89069 Ulm, Germany
{axel, markev, keedy, gisela}@informatik.uni-ulm.de
are (still) one of the challenges for designers of
Abstract
Binary methods are one of the challenges fordesigners
of
object-oriented
programming
languages. In this paper we discuss binary classmethods (class methods that receive parameters oftheir own class type) as an alternative for typicaluses of binary instances methods and show thatthey are often less troublesome, more symmetricaland more expressive. However, the main drawbackof class methods as they are defined in languageslike C++ and Java is that their static bindingexcludes them from being used in certain code-reuse scenarios that need late-bound self-reference. We propose a small and surprisinglysimple language mechanism to overcome thisdrawback. This mechanism can easily be adoptedby languages that offer statically bound classmethods. We further give the semantics of thisextension as a mapping onto an object modelwithout class methods.
object-oriented programming languages as is welldiscussed in that paper. They can be seen as afocus demonstrating the difficulty of combiningthree partly competing goals of modern object-oriented languages: static type safety encapsulation
flexibility in code reuse
In this paper we discuss binary pragmatical classmethods as an alternative for typical uses ofbinary methods (which will be referred to asbinary instance methods for better distinction).In analogy to the definition of a binary instancemethod we define a binary class method as a classmethod of some class defining type τ that has atleast one parameter of this type τ. As with binaryinstance methods, this definition does not excludefurther parameters, and the typical case of abinary class method is indeed a method with twoparameters of type τ.
We first show that binary pragmatical classmethods are often more appropriate and lesstroublesome than binary instance methods. We
1Introduction
A binary method, as defined in [Bru95], is aninstance method of some object of type τ that hasa parameter of the same type τ. Binary methods
Late-bound Pragmatical C... 暂无评价 10页 免费 Late Decaying Dark Matte... 暂无评价 8页 免费 Inhomogeneous big bang n... 暂无评价 17页 免费 ...
Relaxation-strategy-based Modification Branch-and-Bound Algorithm for Solving a Class of Transp_专业资料。Ci.ur..fMahhnQat3ot 21,5()5—5 0021:29 Reato...
Last Friday our class we took part in an Outward Bound_人文社科_专业资料。Last Friday our class we took part in an Outward Bound. In the early ...
热门文档