Abstract
Object orientation is a suitable abstraction for computer graphics, but significant problems exist in specifying relationships between objects, since relationships are not easily encapsulated within the objects concerned. Constraints, where the relationships between objects are maintained by the system, are an especially useful abstraction. Many existing constraint systems are forced to violate encapsulation and hence lose significant benefits of object orientation. This is because constraints are typically expressed by the programmer in terms of internal instance variables, which are then manipulated by the constraint solver to satisfy the constraints. We present a solution which incorporates constraints while maintaining the benefits of object orientation. Constraints are expressed in terms of responses to messages, and are hence independent of the internal implementation of the objects. In addition, the solver uses the interfaces provided by objects to propagate changes, rather than writing directly to instance variables.
Some previous approaches were forced to sacrifice the power of the constraint solver while others are subject to certain restrictions. Examples are given in this paper. We present a solution which does compromise encapsulation (this is unavoidable), but the violation is done in a controlled and localized manner.
Solutions to the constraint set are arrived at by the constraint solver in consultation with constrained objects. Solutions are propagated back to objects strictly via their interfaces.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Harold Abelson and Gerald Jay Sussman. Structure and Interpretation of Computer Programs. The MIT Electrical Engineering and Computer Science Series. MIT Press, 1985.
Edwin Blake. On Including Part Hierarchies in Object Oriented Languages with an Implementation in Smalltalk. In European Conference on Object Orientated Programming, 1987.
G Booch. Object Oriented Design with Applications. Benjamin/Cummings, 1991.
Alan H. Borning. The Programming Language Aspects of Thinglab. ACM Transactions on Programming Languages and Systems, 4 (3): 353 - 387, October 1981.
Alan H. Borning, Robert Duisberg, Bjorn Freeman-Benson, Axel Kramer, and Michael Woolf. Constraint Hierarchies. In Norman Meyrowitz, editor, OOPSLA ’87, OOPSLA, pages 48 – 60. ACM, ACM Press, October 1987.
Eric Cournarie and Michel BeaudouinLafon. ALIEN: A Prototype-based Constraint System. In [14].
Dennis Dingeldein. Modelling multimedia objects with MME. Chap. 7 of this book.
Paris K. Egbert and Travis L. Hilton. Mixed paradigm graphics. Chap. 8 of this book.
Bjorn N. Freeman-Benson . Kaleidoscope: Mixing Objects, Constraints and Imperative Programming. In Norman Meyrowitz, editor, OOPSLA ’90, pages 77–88, Ottawa, Canada, October 1989. Object Oriented Programming: Systems, Languages and Applications, ACM Press.
Bjorn N. Freeman-Benson . Integrating Constraints with an Object-Oriented Language. In ECOOP ’92 European Conference on Object-Oriented Programming, pages 268–286. Springer-Verlag, Berlin, June 1992. This paper is all about Kaleidoscope ’91.
Bjorn N. Freeman-Benson, John Maloney, and Alan Borning. An Incremental Constraint Solver. Communications of the ACM, 33 (l): 54 – 63, January 1990.
Adele Goldberg . Smalltalk-80: the Language and its Implementation. Addison-Wesley series in Computer Science. Addison-Wesley, May 1983.
Chris Laffra . PROCOL: A Concurrent Object Language with Protocols, Delegation, Persistence, and Constraints. PhD thesis, Erasmus University, Rotterdam, May 1992.
Chris Laffra, Edwin Blake, Vicky de Mey, and Xavier Pintado, editors. Object-Oriented Programming for Graphics. Springer-Verlag, 1995.
W. Leler. Constraint Programming Languages: Their Specification and Generation. Addison Wesley Series in Computer Science. Addison-Wesley, 1988.
Brad A. Myers, Dario A. Guise, and Brad van der Zanden. Declarative Programming in a Prototype-Instance System: Object-Oriented Programming Without Writing Methods. In Andreas Paepcke, editor, OOPSLA ’92 Conference on Object-Oriented Systems, Languages and Applications, volume 27 of ACM Sigplan Notices, pages 184–200, Vancouver, British Columbia, Canada, October 1992. ACM, ACM Press.
John R. Rankin. A Graphics Object Oriented Constraint Solver. In C. Laffra et al., editor, Object-Oriented Programming for Graphics, pages 71–91. Springer-Verlag, 1994.
James Rumbaugh . Controlling Propagation of Operations Using Attribures on Relations. In Norman Meyrowitz, editor, OOPSLA, pages 285–296. ACM Press, November 1988.
Greg Schechter, Conal Elliot, Ricky Yeung, and Salim Abi-Ezzi. Functional 3D Graphics in C+ + - with an Object-Oriented Multiple Dispatching Implementation. Chap. 12 of this book.
Ivan E Sutherland . Sketchpad: A Man Machine Graphical Communication System. In Proceedings of the AFIPS Spring Joint Computer Conference, pages 329–346, May 1963.
Remco C. Veltkamp. A Quantum Approach to Geometric Constraint Satisfaction.
Michael R. Wilk. Equate: An Object-Oriented Constraint Solver. In Andreas Paepcke, editor, OOPSLA, pages 286 – 298. ACM Press, October 1991.
Andrew Witkin, Kurt Fleischer, and Alan Barr. Energy Constraints on Parameterized Models. In Computer Graphics, pages 225–2297, Anaheim, California, July 1987. ACM SIGGRAPH.
R. Zeleznik et al. An Object Oriented Framework for the Integration of Interactive Animation Techniques. ACM Computer Graphics (SIGGRAPH 91j, 25 (4): 105–112, July 1991.
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1996 EUROGRAPHICS The European Association for Computer Graphics
About this chapter
Cite this chapter
Hoole, Q., Blake, E. (1996). OOCS — Constraints in an Object Oriented Environment. In: Wisskirchen, P. (eds) Object-Oriented and Mixed Programming Paradigms. Focus on Computer Graphics. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-61062-2_11
Download citation
DOI: https://doi.org/10.1007/978-3-642-61062-2_11
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-64676-8
Online ISBN: 978-3-642-61062-2
eBook Packages: Springer Book Archive