CLASS ENCAPSULATION AND OBJECT ENCAPSULATION - An Empirical Study

Janina Voigt, Warwick Irwin, Neville Churcher

2010

Abstract

Two schools of thought underpin the way OO programming languages support encapsulation. Ob¬ject encap-sulation ensures that private members are accessible only within a single object. Class encapsulation allows private members to be accessed by other objects of the same class. This paper describes an empirical inves-tigation into the way encapsulation is used in practice in class encapsulation languages C# and Java. We find arbitrary and inconsistent programming practices and suggest that object en¬capsula¬tion is more intuitive and provides OO design advantages.

References

  1. Booch, G., Maksimchuk, R., Engle, M., Young, B., Con allen, J., Houston, K. 2007. Object Oriented Design with Applications, Addison Wesley Professional.
  2. Brittanica, E. 1986. Encyclopaedia Brittanica, Chicago, IL, USA, Encyclopaedia Brittanica.
  3. Coad, P., Yourdon, E. 1991. Object Oriented Design, Upper Saddle River, NJ, USA, Yourdon Press.
  4. Eckel, B., Sysop, Z. F. 1998. Thinking in Java, Upper Saddle River, NJ, USA, Prentice Hall PTR.
  5. Fowler, M. 2004. Inversion of Control Containers and the Dependency Injection Pattern [Online]. [Accessed Jan 2010].
  6. Goldberg, A., Robson, D. 1989. Smalltalk-80: The Language, Boston, MA, USA, Addison Wesley Longman.
  7. Hejlsberg, A., Torgersen, M., Wiltamuth, S., Golde, P. 2008. The C# Programming Language, Addison Wesley Professional.
  8. Holub, A. 2003. Why Extends Is Evil. Java World.
  9. Hunt, A., Thomas, D. 1998. Tell, Don't Ask [Online]. Available: http://www.pragprog.com/articles/tell-dontask [Accessed].
  10. Irwin, W. 2007. Understanding and Improving ObjectOriented Software through Static Software Analysis. Ph.D., University of Canterbury.
  11. Irwin, W., Churcher, N. I. 2003. Object Oriented Metrics: Precision Tools and Configurable Visualisations. In: METRICS2003: 9th IEEE Symposium on Software Metrics, Sep 2003 Sydney, Australia. 112-123.
  12. Irwin, W., Cook, C., Churcher, N. I. 2005. Parsing and Semantic Modelling for Software Engineering Applications. In: Strooper, P., ed. Australian Software Engineering Conference, Mar 2005 Brisbane, Australia. IEEE Press, 180-189.
  13. Lieberherr, K., Holland, I. 1989. Assuring Good Style for Object-Oriented Programs. IEEE Software, 6, 38-48.
  14. Martin, R. C. 1997. Stability. C++ Report.
  15. Meyer, B. 1988. Object-Oriented Software Construction, New York, Prentice-Hall.
  16. Parnas, D. L. 1972. On the Criteria to Be Used in Decomposing Systems into Modules. Communications of the ACM, 15, 1053 - 1058.
  17. Qualitas_Research_Group. 2009. Qualitas Corpus Version 20090202 [Online]. Available: http://www. cs.auckland.ac.nz/ewan/corpus [Accessed 2009].
  18. Riel, A. J. 1996. Object-Oriented Design Heuristics, Reading, Mass., Addison-Wesley.
  19. Rogers, P. 2001. Encapsulation Is Not Information Hiding. Java World. http://www.javaworld/javaworld/jw-05- 2001/jw-0518-encapsulation.html
  20. Snyder, A. Year. Encapsulation and Inheritance in ObjectOriented Programming Languages. In: Objectoriented programming systems, languages and applications, 1986. 38-45.
  21. Stroustrup, B. 1994. The Design and Evolution of C++, ACM Press/Addison-Wesley Publishing Co.
  22. Stroustrup, B. 1997. The C++ Programming Language, Boston, MA, USA, Addison Wesley Longman.
  23. Tempero, E. D. Year. How Fields Are Used in Java: An Empirical Study. In: Australian Software Engineering Conference, Apr 2009 2009 Gold Coast, Australia. IEEE Computer Society, 91-100.
  24. Voigt, J., Irwin, W., Churcher, N. I. 2009. Intuitiveness of Class and Object Encapsulation. 6th International Conference on Information Technology and Applications. Hanoi, Vietnam.
  25. Voigt, J., Irwin, W., Churcher, N. I. 2010. Technical Report Tr-Cosc 01/10: List of Qualitas Code Corpus Programs Used for Encapsulation Research [Online]. Christchurch, New Zealand: University of Canterbury. Available: http://www.cosc.canterbury.ac.nz/research/ reports/TechReps/2010/tr_1001.pdf [Accessed].
  26. Yourdon, E., Constantine, L. 1979. Structured Design: Fundamentals of a Discipline of Computer Program and Systems Design, Englewood Cliffs, N. J., Prentice Hall.
Download


Paper Citation


in Harvard Style

Voigt J., Irwin W. and Churcher N. (2010). CLASS ENCAPSULATION AND OBJECT ENCAPSULATION - An Empirical Study . In Proceedings of the Fifth International Conference on Evaluation of Novel Approaches to Software Engineering - Volume 1: ENASE, ISBN 978-989-8425-21-8, pages 171-178. DOI: 10.5220/0002924701710178


in Bibtex Style

@conference{enase10,
author={Janina Voigt and Warwick Irwin and Neville Churcher},
title={CLASS ENCAPSULATION AND OBJECT ENCAPSULATION - An Empirical Study},
booktitle={Proceedings of the Fifth International Conference on Evaluation of Novel Approaches to Software Engineering - Volume 1: ENASE,},
year={2010},
pages={171-178},
publisher={SciTePress},
organization={INSTICC},
doi={10.5220/0002924701710178},
isbn={978-989-8425-21-8},
}


in EndNote Style

TY - CONF
JO - Proceedings of the Fifth International Conference on Evaluation of Novel Approaches to Software Engineering - Volume 1: ENASE,
TI - CLASS ENCAPSULATION AND OBJECT ENCAPSULATION - An Empirical Study
SN - 978-989-8425-21-8
AU - Voigt J.
AU - Irwin W.
AU - Churcher N.
PY - 2010
SP - 171
EP - 178
DO - 10.5220/0002924701710178