Results 1 - 10
of
28
Modular Object-Oriented Programming with Units and Mixins
, 1998
"... Module and class systems have evolved to meet the demand for reuseable software components. Considerable effort has been invested in developing new module and class systems, and in demonstrating how each promotes code reuse. However, relatively little has been said about the interaction of these con ..."
Abstract
-
Cited by 122 (14 self)
- Add to MetaCart
Module and class systems have evolved to meet the demand for reuseable software components. Considerable effort has been invested in developing new module and class systems, and in demonstrating how each promotes code reuse. However, relatively little has been said about the interaction of these constructs, and how using modules and classes together can improve programs. In this paper, we demonstrate the synergy of a particular form of modules and classes—called units and mixins, respectively—for solving complex reuse problems in a natural manner.
A virtual class calculus
, 2005
"... Virtual classes are class-valued attributes of objects. Like virtual methods, virtual classes are defined in an object’s class and may be redefined within subclasses. They resemble inner classes, which are also defined within a class, but virtual classes are accessed through object instances, not as ..."
Abstract
-
Cited by 38 (1 self)
- Add to MetaCart
Virtual classes are class-valued attributes of objects. Like virtual methods, virtual classes are defined in an object’s class and may be redefined within subclasses. They resemble inner classes, which are also defined within a class, but virtual classes are accessed through object instances, not as static components of a class. When used as types, virtual classes depend upon object identity – each object instance introduces a new family of virtual class types. Virtual classes support large-scale program composition techniques, including higher-order hierarchies and family polymorphism. The original definition of virtual classes in BETA left open the question of static type safety, since some type errors were not caught until runtime. Later the languages Caesar and gbeta have used a more strict static analysis in order to ensure static type safety. However, the existence of a sound, statically typed model for virtual classes has been a long-standing open question. This paper presents a virtual class calculus, vc, that captures the essence of virtual classes in these full-fledged programming languages. The key contributions of the paper are a formalization of the dynamic and static semantics of vc and a proof of the soundness of vc. Categories and Subject Descriptors D.3.3 [Language Constructs and Features]: Classes and objects, inheritance, polymorphism; F.3.3 [Studies of Program Constructs]: Object-oriented constructs,
Independently extensible solutions to the expression problem
- In Proc. FOOL 12
, 2005
"... The expression problem is fundamental for the development of extensible software. Many (partial) solutions to this problem have been proposed in the past, but the question of how to use different, independent extensions jointly has received less attention so far. This paper proposes solutions to the ..."
Abstract
-
Cited by 32 (4 self)
- Add to MetaCart
The expression problem is fundamental for the development of extensible software. Many (partial) solutions to this problem have been proposed in the past, but the question of how to use different, independent extensions jointly has received less attention so far. This paper proposes solutions to the expression problem that make it possible to combine independent extensions in a flexible, modular, and typesafe way. The solutions, formulated in the programming language Scala, are affected with only a small implementation overhead and are relatively easy to implement by hand. 1. The Expression Problem Since software evolves over time, it is essential for software systems to be extensible. But the development of extensible software poses many design and implementation problems, especially, if extensions cannot be anticipated. The expression problem is probably the most fundamental one among these problems. It arises when recursively defined datatypes and operations on these types have to be extended simultaneously. The term expression problem was originally coined by Phil Wadler in a post on the Java-Genericity mailing list [34], although it was Cook who first discussed this problem [9]. His work motivated several others to reason about variants of the problem in the following years [18, 27, 17, 12]. In his post to the Java-Genericity mailing list, Wadler also proposed a solution to the problem written in an extended version of GENERIC JAVA [3]. Only later it appeared that this solution could not be typed. For this paper, we paraphrase the problem in the following way: Suppose we have a datatype which is defined by a Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee.
Extensible Algebraic Datatypes with Defaults
, 2001
"... A major problem for writing extensible software arises when recursively defined datatypes and operations on these types have to be extended simultaneously without modifying existing code. This paper introduces Extensible Algebraic Datatypes with Defaults which promote a simple programming pattern to ..."
Abstract
-
Cited by 32 (8 self)
- Add to MetaCart
A major problem for writing extensible software arises when recursively defined datatypes and operations on these types have to be extended simultaneously without modifying existing code. This paper introduces Extensible Algebraic Datatypes with Defaults which promote a simple programming pattern to solve this well known problem. We show that it is possible to encode extensible algebraic datatypes in an object-oriented language, using a new design pattern for extensible visitors. Extensible algebraic datatypes have been successfully applied in the implementation of an extensible Java compiler. Our technique allows for the reuse of existing components in compiler extensions without the need for any adaptations.
Modular typechecking for hierarchically extensible datatypes and functions
- In Proceedings of the International Conference on Functional Programming
, 2002
"... One promising approach for adding object-oriented (OO) facilities to functional languages like ML is to generalize the existing datatype and function constructs to be hierarchical and extensible, so that datatype variants simulate classes and function cases simulate methods. This approach allows exi ..."
Abstract
-
Cited by 30 (5 self)
- Add to MetaCart
One promising approach for adding object-oriented (OO) facilities to functional languages like ML is to generalize the existing datatype and function constructs to be hierarchical and extensible, so that datatype variants simulate classes and function cases simulate methods. This approach allows existing datatypes to be easily extended with both new operations and new variants, resolving a longstanding conflict between the functional and OO styles. However, previous designs based on this approach have been forced to give up modular typechecking, requiring whole-program checks to ensure type safety. We describe Extensible ML (EML), an ML-like language that supports hierarchical, extensible datatypes and functions while preserving purely modular typechecking. To achieve this result, EML’s type system imposes a few requirements on datatype and function extensibility, but EML is still able to express both traditional functional and OO idioms. We have formalized a core version of EML and proven the associated type system sound, and we have developed a prototype
Programming Languages for Reusable Software Components
, 1999
"... Programming languages offer a variety of constructs to support code reuse. For example, functional languages provide function constructs for encapsulating expressions to be used in multiple contexts. Similarly, object-oriented languages provide class (or class-like) constructs for encapsulating sets ..."
Abstract
-
Cited by 24 (0 self)
- Add to MetaCart
Programming languages offer a variety of constructs to support code reuse. For example, functional languages provide function constructs for encapsulating expressions to be used in multiple contexts. Similarly, object-oriented languages provide class (or class-like) constructs for encapsulating sets of definitions that are easily adapted for new programs. Despite the variety and abundance of such programming constructs, however, existing languages are ill-equipped to support component programming with reusable software components. Component programming differs from other forms of reuse in its emphasis on the independent development and deployment of software components. In its ideal form, component programming means building programs from off-the-shelf components that are supplied by a software-components industry. This model suggests a strict separation between the producer and consumer of a component. The separation, in turn, implies separate compilation for components, allowing a pr...
The Expression Problem Revisited — Four new solutions using generics
- In Proceedings of the 18th European Conference on Object-Oriented Programming
, 2004
"... Abstract. The expression problem (aka the extensibility problem) refers to a fundamental dilemma of programming: To which degree can your application be structured in such a way that both the data model and the set of virtual operations over it can be extended without the need to modify existing cod ..."
Abstract
-
Cited by 23 (0 self)
- Add to MetaCart
Abstract. The expression problem (aka the extensibility problem) refers to a fundamental dilemma of programming: To which degree can your application be structured in such a way that both the data model and the set of virtual operations over it can be extended without the need to modify existing code, without the need for code repetition and without runtime type errors. Over the years, many approaches to this problem have been proposed, each having different characteristics of type safety and reusability. While many of these rely on exotic or problem specific language extensions, this paper investigates the solution space within the framework of the soonto-be mainstream generic extensions of C # and the Java programming language. Four new solutions are presented which, though quite different, all rely on techniques that can be used in everyday programming. 1
Some Challenging Typing Issues in Object-Oriented Languages (Extended Abstract)
, 2003
"... Kim B. Bruce 1,2 Department of Computer Science Williams College Williamstown, MA 01267, U.S.A. ..."
Abstract
-
Cited by 18 (1 self)
- Add to MetaCart
Kim B. Bruce 1,2 Department of Computer Science Williams College Williamstown, MA 01267, U.S.A.
Matching Objects with Patterns
- ECOOP 2007 – Object-Oriented Programming, volume 4609 of LNCS
, 2007
"... Abstract. Data in object-oriented programming is organized in a hierarchy of classes. The problem of object-oriented pattern matching is how to explore this hierarchy from the outside. This usually involves classifying objects by their run-time type, accessing their members, or determining some othe ..."
Abstract
-
Cited by 16 (1 self)
- Add to MetaCart
Abstract. Data in object-oriented programming is organized in a hierarchy of classes. The problem of object-oriented pattern matching is how to explore this hierarchy from the outside. This usually involves classifying objects by their run-time type, accessing their members, or determining some other characteristic of a group of objects. In this paper we compare six different pattern matching techniques: object-oriented decomposition, visitors, type-tests/type-casts, typecase, case classes, and extractors. The techniques are compared on nine criteria related to conciseness, maintainability and performance. The paper introduces case classes and extractors as two new pattern-matching methods and shows that their combination works well for all of the established criteria. 1
Implementing Extensible Compilers
- IN ECOOP WORKSHOP ON MULTIPARADIGM PROGRAMMING WITH OBJECT-ORIENTED LANGUAGES
, 2001
"... New extensions to programming languages are constantly being proposed. But implementing these extensions usually turns out to be a very di#cult and expensive task, since conventional compilers often lack extensibility and reusability. In this paper we present some fundamental techniques to imple ..."
Abstract
-
Cited by 13 (6 self)
- Add to MetaCart
New extensions to programming languages are constantly being proposed. But implementing these extensions usually turns out to be a very di#cult and expensive task, since conventional compilers often lack extensibility and reusability. In this paper we present some fundamental techniques to implement extensible compilers in an object-oriented language. For being able to implement extensible compiler passes, we introduce an extensible form of algebraic datatypes. Our extensible algebraic datatypes with defaults yield a simple programming protocol for implementing extensible and reusable compiler passes in a functional style. We propose an architectural design pattern ContextComponent which is specifically targeted towards building extensible, hierarchically composed systems. Our software architecture for extensible compilers combines the use of algebraic types, known from functional languages, with this object-oriented design pattern. We show that this approach enables us to extend existing compilers flexibly without modifying any source code. Our techniques have been successfully applied in the implementation of the extensible Java compiler JaCo.

