In this interactive talk, ROCOCO plugin will be demonstrated which is developed in JDT by applying annotation processing to enable and encourage the programmer to depict behavioral code as role oriented concurrent contexts in plain JAVA.
With the talk, by demonstrating the ideas in the code which will be interactively written together with the audience in eclipse IDE with ROCOCO plugin, it is intended to increase the awareness of the audience on the fundamental deficiency of object orientation and on the importance of immediate responses and warnings from the IDE without waiting to observe or test the system, as well as to demonstrate for the first time that the single-threaded constraint of DCI is relaxed.
The motivation for ROCOCO and what has been accomplished so far and what will be demonstrated is summarized as below:
The programmer's cognitive mastery and sense of responsibility about what the system will do at run time decreases day by day. In this study, Data Context Interaction (DCI), Design by Contract (DbC) and Simple Concurrent Object Oriented Programming (SCOOP) techniques are combined in ROCOCO (Role Oriented Concurrent Contexts) eclipse plugin which is developed by applying annotation processing with JDT to depict the interoperability of concurrent objects in code.
Advances in technology and ever increasing computational power opens up new frontiers for programming world too. We can now start to speak about programs generating other programs, programs generating test cases by constraining the case space to test and even tools to prove that the code will completely work as expected or not by exploiting the formal specifications which were provided by the programmer. The modern integrated development environments (IDE) should be able to interact more throughly with programmer by immediately recognizing the impacts of her current amendments in the source code and warn her if anything may go wrong. This dialogue like interaction between IDE and programmer is important for maintaining the focus of the programmer on the code without waiting to observe what the software will do at run time. Study introduces ROCOCO (Role Oriented Concurrent Contexts) as a plugin to provide an environment for the programmer to code with full support on both role oriented and concurrent aspects of programming from the IDE which understands the intent of her by exploiting annotations and warns her at compile time about the structural errors her recent amendments on code will cause without the need to test the code at run time.
When the code does not reveal exactly how the software will behave at run time, the behavior is expressed with various analysis and design artifacts such as Unified Modeling Language (UML) collaboration and UML activity diagrams. Test scripts were coded with the xUnit family (JUnit, NUnit, etc.) to make sure that the software behaves as desired. Here, we do not argue the value of these techniques, the point we want to emphasize with these examples is that the deep need for all such techniques points to a very basic problem, a fundamental deficiency in object orientation; the absence of a place in code to describe behavior.
ROCOCO exploits the fact that the communication between the context and the data objects which play some role in that context is one way in DCI way role orientation. Data objects are not aware about the contexts they may play a role within, but contexts know at construction time all it needs to know about each data object as a role player. In DCI, formation of contexts is atomic, i.e. all data objects are bound to the context as role players at the time when the context is constructed. Therefore, we can take the source code line where the context instance is constructed as the reference for ROCOCO transformation to reduce the role oriented code to object orientated code just like any high level languages which are eventually reduced to bytecodes the end. As programmer continues to use the IDE, each context construction code is visited by Java Development Toolkit (JDT) observers of the ROCOCO plugin. The specialized context class will be suffixed with _asCalledFrom_SourceCodeFileName_Line# and role classes in that context class will be rename refactored with data object classes which will play those roles at that specific source code line by the ROCOCO plug-in.
With ROCOCO, after specifying the role oriented and concurrent intent of her code, programmer feels safe that IDE will warn her whether there is a structural problem about concurrent role orientation or not in her code which may lead to a problem, race condition or crush at run-time.
The main contribution of the study is to demonstrate that it is possible to build an interactive development environment which will let the programmer specify not only the concurrent or role oriented code alone but specify both role oriented and concurrent code together, and to relax the single-threaded constraint of DCI by this synthesis.
We hope that this study, which is based on annotations only, will find a response in industry and we will have more reliable interactive development environments.