CS 4448 - Spring 1998
Object-Oriented Programming and Design
Talk 4.2.2
by
David Grimes
Beyond the Black Box: Open Implementation
by
Gregor Kiczales
Intro to OI - Open Implementation
- Open Implementation is a somewhat new design principle that strives
to build a better abstraction model than the "Black Box".
- Main concern deals with code reuse. In particular OI tries to
match performance of OO reused software system with self-built procedural
software systems.
Motivation and Examples
- Object Oriented systems are often criticized by their lack of performance.
The author of this article feels that this is because in wanting to hide implementation
details from the user of a module, the programmer often makes critical performance decisions
that actually should have been left up to the client.
- The example in the article describes the situation of the implementor of a spreadsheet
program. The implementor assumes that it will be fairly easy due to the abstraction of the
windowing system, and the hidden nature of its implementation. However when the application
programmer runs the application he/she finds that it is very slow and a resource hog. The reason
lies in the fact that the windowing system programmer made critical decisions that will work for a
majority of its users but will result in bad performance in some situations.
- Other examples includes a threading package that does not allow for much control in thread
scheduling. A virtual memory manager that uses an MRU (most recently used) instead of a LRU (least
recently used) algorithm for page swapping.
How to do OI
- The big question here is how to give the client some say in the implementation of a software module.
There are certainly very big safety issues, for example we would not want to allow the client to make
a set of decisions that were incompatible or that would introduce many bugs, as that would certainly not lead to code reuse.
- Meta-interfaces allow the client to make critical implementation decisions without knowing all the
details. In the meta-interface paradigm it is essential to keep the overall black box abstraction
interface and the meta-interface separate. This lets the application programmer write code and assume
that the black box will do the best possible thing for the particular situation. Then if performance is
lacking the meta-interface can then be used to tweak performance.
- This image shows the separation of the meta and
standard interfaces.
- Meta-Object Protocols (MOPS) are a way of implementing a meta-interface in a
standardized and safe fashion.
Client programmers can replace one or more objects with specialized ones to affect
specific aspects of the implementation of specific parts of their program.
Conclusion
- Open Implementation and other "open" strategies are growing rapidly and being actively researched
throughout the software engineering community. The goal is to increase code reuse and performance by
modifying and improving the canonical Black Box model for abstraction.
For more information:
Copyright © University of Colorado. All rights reserved.
Revised: February 12, 1998