Enriching Java Enterprise interfaces with formal sequential contracts
Marco Konersmann, Moritz Balz, Michael Goedicke · 2011
Many software systems are stateful or have stateful components, i.e. they manage and process data depending on certain steps performed before. For this reason, sequential contracts are of interest that describe component interfaces with respect to sequences of invocations leaving the component in a valid state. While sophisticated models for this purpose exist, component frameworks don't support sequential contracts, so that a validation of the state is performed algorithmically and mixed-up with application logic in method contents. In this contribution we present (1) meta data for object-oriented program code that allow to annotate component interfaces with sequential contracts and (2) a pattern and tools integrating sequential contracts in Java Enterprise components. The contracts can then be modeled as part of the program code at development time and be interpreted at run time to prevent invalid method invocations and provide tracing data in case of errors.