ABSTRACT
Many programming languages provide features that express restrictions on which data structures can be changed. For example, C++ includes const and Java includes final. Languages that are in widespread use typically provide non-transitive immutability: when a reference is specified to be immutable or read-only, the object referenced can still reference mutable structures. However, some languages, particularly research languages, provide transitive immutability, in which immutable objects can only reference other immutable objects (with some exceptions). We are designing a lab study of programmers to elucidate the differences in programmer effectiveness between these two approaches.
- Bloch, J. Effective Java, Second Edition. Mountain View, CA Sun Microsystems, 2008. Google ScholarDigital Library
- Oracle Corp. Secure Coding Guidelines for the Java SE, version 4.0. http://www.oracle.com/technetwork/java/seccodeguide- 139067.html#6Google Scholar
- Zibin, Y., Potanin, A., Ali, M., Artzi, S., Kie, A. un, and Ernst, M. D. (2007). Object and Reference Immutability Using Java Generics. In Proceedings of the 11th European Software Engineering Conference and the 15th ACM SIGSOFT Symposium on the Foundations of Software Engineering (pp. 7584). New York, NY, USA: ACM. Google ScholarDigital Library
- Pechtchanski, I., and Sarkar, V. (2002). Immutability specification and its applications. In Proceedings of the 2002 Joint ACM-ISCOPE conference on Java Grande - JGI ’02 (pp. 202- 211). New York, NY, USA: ACM Press. Google ScholarDigital Library
- Microsoft, Inc. Freezable Objects Overview. https://msdn.microsoft.com/enus/library/vstudio/ms750509(v=vs.100).aspx.Google Scholar
- Stylos, J. and Clarke, S. Usability Implications of Requiring Parameters in Objects’ Constructors. In International Conference on Software Engineering (ICSE’2007). Minneapolis, MN: pp. 529–539. Google ScholarDigital Library
- The Rust Programming Language. Mozilla Research. https://www.rust-lang.org.Google Scholar
Index Terms
- Comparing transitive to non-transitive object immutability
Recommendations
Exploring language support for immutability
ICSE '16: Proceedings of the 38th International Conference on Software EngineeringProgramming languages can restrict state change by preventing it entirely (immutability) or by restricting which clients may modify state (read-only restrictions). The benefits of immutability and read-only restrictions in software structures have been ...
Object and reference immutability using Java generics
ESEC-FSE '07: Proceedings of the the 6th joint meeting of the European software engineering conference and the ACM SIGSOFT symposium on The foundations of software engineeringA compiler-checked immutability guarantee provides useful documentation, facilitates reasoning, and enables optimizations. This paper presents Immutability Generic Java (IGJ), a novel language extension that expresses immutability without changing Java'...
Ownership and immutability in generic Java
OOPSLA '10The Java language lacks the important notions of ownership (an object owns its representation to prevent unwanted aliasing) and immutability (the division into mutable, immutable, and readonly data and references). Programmers are prone to design errors,...
Comments