•  
  •  
 

Abstract

A pervasive mechanism is proposed to declare that variables and object instances are mutable or immutable, and whether methods mutate instances. These declarations are integral to the type structure of the language and allow the developer to declare, and the reader (and compiler) to determine, if a variable or instance is immutable (even if other instances of the Class are mutable) or that an instance is immutable throughout the application (a Pure instance). The concept of the owner or outsiders of variables and instances is combined with a series of tags to declare mutability, and can be enforced during compilation. This provides a more informative definition of the interface for a Class, requires fewer lines of code for implementation, and reduces the runtime overhead of defensive coding (creating clones). In a multi-threaded application, flagging a Pure instance to the JVM can provide significant performance improvements by eliminating unnecessary synchronizations. Many of the benefits recognized for Functional Programming are introduced to Java as an optional enhancement.

Share

COinS
 
 

To view the content in your browser, please download Adobe Reader or, alternately,
you may Download the file to your hard drive.

NOTE: The latest versions of Adobe Reader do not support viewing PDF files within Firefox on Mac OS and if you are using a modern (Intel) Mac, there is no official plugin for viewing PDF files within the browser window.