Skip to main content

OOCS — Constraints in an Object Oriented Environment

  • Chapter
Object-Oriented and Mixed Programming Paradigms

Part of the book series: Focus on Computer Graphics ((FOCUS COMPUTER))

  • 84 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 16.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Harold Abelson and Gerald Jay Sussman. Structure and Interpretation of Computer Programs. The MIT Electrical Engineering and Computer Science Series. MIT Press, 1985.

    Google Scholar 

  2. Edwin Blake. On Including Part Hierarchies in Object Oriented Languages with an Implementation in Smalltalk. In European Conference on Object Orientated Programming, 1987.

    Google Scholar 

  3. G Booch. Object Oriented Design with Applications. Benjamin/Cummings, 1991.

    Google Scholar 

  4. Alan H. Borning. The Programming Language Aspects of Thinglab. ACM Transactions on Programming Languages and Systems, 4 (3): 353 - 387, October 1981.

    Article  Google Scholar 

  5. 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.

    Google Scholar 

  6. Eric Cournarie and Michel BeaudouinLafon. ALIEN: A Prototype-based Constraint System. In [14].

    Google Scholar 

  7. Dennis Dingeldein. Modelling multimedia objects with MME. Chap. 7 of this book.

    Google Scholar 

  8. Paris K. Egbert and Travis L. Hilton. Mixed paradigm graphics. Chap. 8 of this book.

    Google Scholar 

  9. 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.

    Google Scholar 

  10. 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.

    Google Scholar 

  11. Bjorn N. Freeman-Benson, John Maloney, and Alan Borning. An Incremental Constraint Solver. Communications of the ACM, 33 (l): 54 – 63, January 1990.

    Article  Google Scholar 

  12. Adele Goldberg . Smalltalk-80: the Language and its Implementation. Addison-Wesley series in Computer Science. Addison-Wesley, May 1983.

    Google Scholar 

  13. Chris Laffra . PROCOL: A Concurrent Object Language with Protocols, Delegation, Persistence, and Constraints. PhD thesis, Erasmus University, Rotterdam, May 1992.

    Google Scholar 

  14. Chris Laffra, Edwin Blake, Vicky de Mey, and Xavier Pintado, editors. Object-Oriented Programming for Graphics. Springer-Verlag, 1995.

    Google Scholar 

  15. W. Leler. Constraint Programming Languages: Their Specification and Generation. Addison Wesley Series in Computer Science. Addison-Wesley, 1988.

    Google Scholar 

  16. 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.

    Google Scholar 

  17. 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.

    Google Scholar 

  18. James Rumbaugh . Controlling Propagation of Operations Using Attribures on Relations. In Norman Meyrowitz, editor, OOPSLA, pages 285–296. ACM Press, November 1988.

    Google Scholar 

  19. 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.

    Google Scholar 

  20. Ivan E Sutherland . Sketchpad: A Man Machine Graphical Communication System. In Proceedings of the AFIPS Spring Joint Computer Conference, pages 329–346, May 1963.

    Google Scholar 

  21. Remco C. Veltkamp. A Quantum Approach to Geometric Constraint Satisfaction.

    Google Scholar 

  22. Michael R. Wilk. Equate: An Object-Oriented Constraint Solver. In Andreas Paepcke, editor, OOPSLA, pages 286 – 298. ACM Press, October 1991.

    Google Scholar 

  23. Andrew Witkin, Kurt Fleischer, and Alan Barr. Energy Constraints on Parameterized Models. In Computer Graphics, pages 225–2297, Anaheim, California, July 1987. ACM SIGGRAPH.

    Google Scholar 

  24. 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.

    Google Scholar 

Download references

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics