Intuitiveness of Class and Object Encapsulation (2009)
Type of ContentConference Contributions - Published
PublisherUniversity of Canterbury. Computer Science and Software Engineering
AuthorsVoigt, J., Irwin, W., Churcher, N.show all
Encapsulation is one of the most fundamental programming language mechanisms available to software developers for managing the complexity of software systems. One might therefore expect clear guidelines and consistent practices to be used in mature programming languages, and particularly in object oriented (OO) languages, with their rich support for encapsulation. However, the encapsulation practices employed by OO developers are surprisingly variable, even within a given OO language. Published advice on how best to use encapsulation is conflicting and little research has been done to determine what developers do in practice and why. In this work, we focus on one aspect of encapsulation: the encapsulation boundary in OO systems. In the archetypal OO language Smalltalk, object data is private to an object. On the other hand, in statically typed OO languages such as C# and Java, object data is private to a class. This difference has broad implications for software design and maintenance, especially when inheritance is considered. Using a survey of both novice and experienced software developers, we show that the encapsulation boundary supported by mainstream statically typed languages does not coincide with the intuition of most developers.
CitationVoigt, J., Irwin, W., Churcher, N. (2009) Intuitiveness of Class and Object Encapsulation. Hanoi, Vietnam: 6th International Conference on Information Technology and Applications, 9-12 Nov 2009. 83-88.
This citation is automatically generated and may be unreliable. Use as a guide only.