For various reasons, I find myself needing to know something about object-oriented programming and seek help from my learned friends and acquaintances in understanding what it is all about in categorical terms. "Object-speak" is the terminology used in the so called object- oriented technology, implemented in the (now ten year old) programming language C++ and in other languages as well. It uses terms (taken here from David A. Taylor's "Object- Oriented Technology" Addison-Wesley 1990) such as: object: a software packet that contains a collection of related data (in the form of variables) and methods for operating on that data. method: a procedure contained within an object that is made available to other objects. message: a signal from one object to another that requests the receiving object to carry out one of its methods. class: a template for defining the methods and variables for a particular type of object; can contain subclasses which are special cases. instance: refers to an object that belongs to a particular class. inheritance: a mechanism whereby classes can make use of the methods and variables defined in all classes above them on their branch of the class hierarchy. encapsulation: a technique in which data is packaged together with its corresponding procedures. In object- oriented technology, the mechanism for encapsulation is the object. data abstraction: the process of defining new higher-level data types. polymorphism: the ability to hide different implementations behind a common interface to simplify communications among objects. What does all this really mean? Does all this structure lead to (or arise from) a theory? Is there an interpretation of "object-speak" in a category (with what properties ?) so that it might be understood in category theoretic terms? Are there any references that explicitly make such a connection? Al Vilcius, Toronto ==============================================================================
Regarding the question by Al Vilcius, the most direct correspondence with category theory that I am aware of is in my recent work on the foundations of object-oriented programming using rewriting logic. Two relevant refences are: "Conditional Rewriting Logic as a Unified Model of Concurrency," Theoretical Computer Science, 96, 73-155, 1992. "A Logical Theory of Concurrent Objects and its Realization in the Maude Language," Technical Report SRI-CSL-92-08, Comp. Sci. Lab., SRI International, July 1992. The first paper focuses more on the logic and the categorical foundations but contains also a discussion of object-oriented programming and of other models. The second treats in much more detail the foundations of object-oriented programming. The report can be obtained free of charge by writing or sending email to: Mrs. Judith Burgess Computer Science Laboratory 333 Ravenswood Avenue Menlo Park CA 94025, USA (burgess@csl.sri.com) Jose Meseguer ==============================================================================
Dear Al Vilcius, Yes, I have done some work along the lines that you query, using theories and models from hidden sorted equational logic to explicate classes and objects. You can find details in @incollection(tpasth, title = "Types as Theories", author = "Joseph Goguen", booktitle = "Topology and Category Theory in Computer Science", editor = "George Michael Reed and Andrew William Roscoe and Ralph F. Wachter", publisher = "Oxford", year = 1991, pages = "357--390", note = "Proceeding of a Conference held at Oxford, June 1989") As a general orienting remark (pun intended), existing languages tend to have been designed from an ad hoc, partial instantiation of the relevant concepts. For example, C++ was constrained to be an extension of C, and hence inherits all of its faults and limitations, with the result that it cannot realise the full potential of the object paradigm. Also, I do not quite agree with all of the definitions that you quote. In particular, it is significant that "objects" have actual dedicated local storage; hence, they are not just software; they are run-time entities. And "polymorphism" as usually understood in computing has to do with overloading operations; perhaps this is intended to be a reference to what is usually called "dynamic binding"? If so, it is unnecessarily oblique and obscure. The definition of "data abstraction" is not much better. Yours, Joseph Goguen &&&&&&&&&&&&&&&&&&&&&&&&&&&&& Signature File &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& Joseph A. Goguen, Professor of Computing Science, Programming Research Group, University of Oxford, 11 Keble Road, Oxford OX1 3QD, United Kingdom. email: Joseph.Goguen@prg.ox.ac.uk [internet] -- usually also works in the UK, but if not, try Joseph.Goguen@uk.ac.ox.prg phone: 272567 [my office]; 272568 [secy]; 273838 [PRG office]; 273839 or 272582 [FAX]. From USA, dial 011-44-865-...; from UK, dial (0865)-... ============================================================================== 1aug92-1jan93, sabbatical: Technical University of Nova Scotia School of Computer Science P.O.Box 1000, Halifax, Nova Scotia, Canada B3J 2X4 phone: (902)420-7776 [direct]; (902)420-7718 [sec]; (902)420-7858 [fax] email: goguenja@newton.ccs.tuns.ca [email to goguen@prg.ox.ac.uk should also be forwarded] Our home address is: 5742 Victoria Rd, Halifax, Nova Scotia B3H 1N2 Canada phone: (902)422-1361 ==============================================================================
I think we've been through this before, on another forum, and I do not want to sound overly polemical or partisan, but I do want to put in my two-cents worth (or whatever currency is appropriate wherever you are reading this). While I like what Goguen and Meseguer have done, separately and in collaboration, I think there are many important aspects of object-oriented programming that their work does not address. This is true of my work as well, although I think for different reasons. I believe that there are aspects of object-oriented programming that are important to programming practicianers (the kind that go to object-oriented programming conferences, not the ones with big DARPA contracts) that have not been adequately characterized in a mathematical way by any of us. For those interested in applying their favorite mathematical theory to a practical (and relatively abstract) problem, I would advocate attempting to formalize aspects of object-oriented programming. Did I offend anyone? I hope not. I just don't think the answers are in yet. John Mitchell ==============================================================================
participants (4)
-
Al Vilcius -
John C. Mitchell -
Jose Meseguer -
Joseph A Goguen