Abstract. Design by Contract is a software engineering practice that allows semantic information to be added to a class or interface to precisely specify the conditions that are required for its correct operation. The basic constructs of Design by Contract are method preconditions and postconditions, and class invariants.This paper presents a detailed design and implementation overview of jContractor, a freely available tool that allows programmers to write "contracts" as standard Java methods following an intuitive naming convention. Preconditions, postconditions, and invariants can be associated with, or inherited by, any class or interface. jContractor performs on-the-fly bytecode instrumentation to detect violation of the contract specification during a program's execution. jContractor's bytecode engineering technique allows it to specify and check contracts even when source code is not available. jContractor is a pure Java library providing a rich set of syntactic constructs for expressing contracts without extending the Java language or runtime environment. These constructs include support for predicate logic expressions, and referencing entry values of attributes and return values of methods. Fine grain control over the level of monitoring is possible at runtime. Since contract methods are allowed to use unconstrained Java expressions, in addition to runtime verification they can perform additional runtime monitoring, logging, and analysis.
INTRODUCING CONCURRENCY TO A SEQUENTIAL LANGUAGEe introduce concurrency to the object-oriented language Eiffel through a set of Class Libraries and an associated concurrent programming design method. This concurrency mechanism is well suited for client/server style distributed applications. The essential principles of sequential object-oriented programming offered by Eiffel are not sacrificed, since no changes are made to the Eiffel Language [19], or its run-time system. Our concurrency abstractions are presented as encapsulated behavior of Eiffel objects that can be inherited from the CONCURRENCY Class. Although the design described here is specific to the Eiffel language, most of these abstractions are generally applicable to other object-oriented languages such as C + + [14], and Objective-C [13].The main concurrency abstractions provided by our mechanisms are objects as processes--active objects--and an asynchronous remote method invocation with data-driven synchronization. The view of objects as processes, having a protected private state and a prescribed behavior, provides the bridge to parallelism. Also the communication/synchronization aspects of concurrent programming blend well with the method invocation model of computation in object-oriented programming.There have been numerous proposals in recent years to combine concurrent programming with object-oriented programming. We can identify three distinct approaches for introducing concurrency to object-oriented systems: Design a new concurrent object-oriented languageCOmMUN|CATmONm OP TMm ACN September 1993/Vol.36, No.9 103 C:OMMUNICATIONSOPTNIIACM Scptcmber 1993/Vol,36, No.9 SOS storage put( Item: DATA ): BOOLEAN is -do if not buffer, full then buffer.put (Item);-append to buffer Result:= true; else --return false for failure Result:= false; end; --if end; --put get: DATA is -do if not buffer.empty then buffer.remove; -remove the oldest item in buffer Result := buffer.item; -return the removed item else --return a Void object for failure Result.Forget;--Result made Void end; --if end; --get end --class BUFFER
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
customersupport@researchsolutions.com
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Copyright © 2024 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.