Using types to enforce architectural structure
Software architecture describes the high-level structure of a software system, and can be used for design, analysis, and software evolution tasks. However, existing tools decouple architecture from implementation, allowing inconsistencies to accumulate as a software system evolves. Because of the potential for inconsistency, engineers evolving a program cannot fully trust the architecture to accurately describe the properties or structure of the implementation.This dissertation explores a new approach: integrating architectural descriptions into an implementation language, and using a type system to ensure that the architectural structure is consistent with the code. The approach is embodied in the ArchJava language, which extends Java with features that document the software architecture and data sharing within a system. ArchJava's type system enforces communication integrity, the property that implementation components communicate only along connections declared in the architecture. ArchJava is flexible enough to describe architectures that may change at run time, and it supports many of the same coding styles and idioms that programmers use in Java. Several case studies applying ArchJava to existing programs of significant size provide preliminary evidence that ArchJava is practical and can aid software evolution tasks.