Abstract
Access modifiers like public and private let the programmer control the accessibility of class members. Restricted accessibility supports encapsulation, i.e., the hiding of implementation details behind the interface of a class. However, what is an implementation detail and what makes the interface of a class is often subject to change: especially in an agile setting (with absence of an upfront design dictating accessibility levels), the interface of a class evolves much like its implementation, settling only towards the finalization of a project. However, while insufficient accessibility is reported by the compiler, excessive accessibility is not, the effect being that massively refactored programs usually end up with larger interfaces than necessary. With our Access Modifier Modifier tool, we allow programmers to increase and keep accessibility at higher levels during the development phase, and reduce it only once the required access has stabilized. Fixed design decisions (such as a published API) can be designated by corresponding annotations, making them immune to changes through our tool. Evaluating the Access Modifier Modifier on a number of internal packages taken from the Java open source community, we found that accessibility was excessive in 32% of cases on average.
Keywords
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Ardourel, G., Huchard, M.: Access graphs: Another view on static access control for a better understanding and use. Journal of Object Technology 1(5), 95–116 (2002)
Create Privately Publish Later, http://c2.com/ppr/wiki/JavaIdioms/CreatePrivatelyPublishLater.html
Devanbu, P.T., Balzer, B., Batory, D.S., Kiczales, G., Launchbury, J., Parnas, D.L., Tarr, P.L.: Modularity in the new millenium: A panel summary. In: ICSE, pp. 723–724 (2003)
Eclipse Naming Conventions, http://wiki.eclipse.org/Naming_Conventions#Internal_Implementation_Packages
M Fowler Refactoring: Improving the Design of Existing Code. Addison-Wesley (1999)
Fowler, M.: Public versus published interfaces. IEEE Software 19(2), 18–19 (2002)
Gamma, E., Helm, R., Johnson, R.: J Vlissides Design Patterns – Elements of Reusable Software. Addison-Wesley (1995)
Package Naming Conventions Used in the Apache Harmony Class Library, http://harmony.apache.org/subcomponents/classlibrary/pkgnaming.html
Gosling, J., Joy, B., Steele, G., Bracha, G.: The Java Language Specification, http://java.sun.com/docs/books/jls/
Großkinsky, E.: Access Modifier Modifier: Ein Werkzeug zur Einstellung der Sichtbarkeit in Java-Programmen (Master-Arbeit, Lehrgebiet Programmiersysteme, Fernuniversität in Hagen (2007)
Kegel, H.: Constraint-basierte Typinferenz für Java 5 (Diplomarbeit, Fakultät für Mathematik und Informatik, Fernuniversität in Hagen 2007)
Kegel, H., Steimann, F.: Systematically refactoring inheritance to delegation in Java. In: ICSE (2008)
Kiczales, G., Mezini, M.: Aspect-oriented programming and modular reasoning. In: ICSE, pp. 49–58 (2005)
Koved, L., Pistoia, M., Kershenbaum, A.: Access rights analysis for Java. In: OOPSLA, pp. 359–372 (2002)
Leeman, G., Kershenbaum, A., Koved, L., Reimer, D.: Detecting unwanted synchronization in Java programs. In: Conf. on Software Engineering and Applications, pp. 122–132 (2004)
Liskov, B., Wing, J.M.: A behavioral notion of subtyping. ACM Trans. Program. Lang. Syst. 16(6), 1811–1841 (1994)
Meyer, B.: Object-Oriented Software Construction, 2nd edn. Prentice Hall International (1997)
Palsberg, J., Schwartzbach, M.I.: Object-oriented type inference. In: Proc. of OOPSLA, pp. 146–161 (1991)
Parnas, D.L.: On the criteria to be used in decomposing systems into modules. Commun. ACM 15(12), 1053–1058 (1972)
BC Pierce Types and Programming Languages. MIT Press (2002)
Steimann, F., Mayer, P.: Patterns of interface-based programming. Journal of Object Technology 4(5), 75–94 (2005)
Steimann, F.: The paradoxical success of aspect-oriented programming. In: OOPSLA, pp. 481–497 (2006)
Steimann, F.: The Infer Type refactoring and its use for interface-based programming. Journal of Object Technology 6(2), 67–89 (2007)
Tip, F.: Refactoring using type constraints. In: Riis Nielson, H., Filé, G. (eds.) SAS 2007. LNCS, vol. 4634, pp. 1–17. Springer, Heidelberg (2007)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2008 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Bouillon, P., Großkinsky, E., Steimann, F. (2008). Controlling Accessibility in Agile Projects with the Access Modifier Modifier. In: Paige, R.F., Meyer, B. (eds) Objects, Components, Models and Patterns. TOOLS EUROPE 2008. Lecture Notes in Business Information Processing, vol 11. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-69824-1_4
Download citation
DOI: https://doi.org/10.1007/978-3-540-69824-1_4
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-69823-4
Online ISBN: 978-3-540-69824-1
eBook Packages: Computer ScienceComputer Science (R0)