spec -> mainClassName{getClassName};
spec, mainClassName, packagePath ->
classList{makeClassList};
classList,mainClassName->problem{makeProblem};
When designing metainterfaces, we had to decide
how to use the existing code. We decided to fol-
low the design of CoCoViLa as much as possible. In
the case of Parser, this meant the usage of an in-
termediate data structure of type ClassList. This
decision, in its turn, permitted to use the methods
makeClassList and makeProblem in the implemen-
tation of the Parser metaclass without any changes.
As we can see from the example of Parser,
the design of metainterfaces required some analy-
sis of the CoCoViLa source. It included a private
class Synthesizer that controlled the whole program
construction process, and used other classes where
needed. It was obvious that the existing classes could
not serve immediately as implementations of compo-
nents of the new model. An interesting question was,
how much changes were needed. It came out that
only minor changes of code were needed for imple-
mentation of methods after careful design of metain-
terfaces. This work was performed in two days by a
programmer who had an acquaintance with the Co-
CoVila code.
7 CONCLUSIONS
We have shown here on three examples how a tool
supporting the usage of Java classes supplied with
logical specifications can be used in compositional
programming. The first example concerns a practi-
cally important case of development and usage of a
domain specific visual language. It demonstrates also
the scalability of the method – a hierarchical specifi-
cation that after unfolding has thousands of interface
variables gives 8920 lines of synthesized code in one
second. The second example is about automatic com-
position of services. Atomic services that are com-
ponents have to be collected in large service models
first, and the models are used then for specifying the
services to be synthesized. From our point of view,
the most important is the third example. This demon-
strates the feasibility of using the tool in a software
development project where domain specific language
has only a secondary role. The main domain specific
asset in this case is a system model that can be used as
a specification for composing the software. This en-
ables us to separate compositional specification from
implementation, and is useful for organizing a soft-
ware project.
ACKNOWLEDGEMENTS
This research has been partially supported by the Eu-
ropean Regional Development Fund (ERDF) through
Estonian Center of Excellence in Computer Sci-
ence (EXCS), target-financed research theme No.
0140007s12 of the Estonian Ministry of Education
and Research, and the project No. 3.2.1201.13-0026
Model-based Java software development technology.
REFERENCES
Brambilla, M., Cabot, J., and Wimmer, M. (2012). Model-
driven software engineering in practice. Synthesis
Lectures on Software Engineering, 1(1):1–182.
Constable, R. L. (1971). Constructive mathematics and au-
tomatic program writers. In Proceedings of the IFIP
Congress, pages 229–233. North-Holland.
Green, C. (1980). The application of theorem proving to
question-answering systems. Outstanding disserta-
tions in the computer sciences. Garland Pub.
Grigorenko, P., Saabas, A., and Tyugu, E. (2005). Visual
tool for generative programming. In ACM SIGSOFT
Software Engineering Notes, volume 30, pages 249–
252. ACM.
Grigorenko, P. and Tyugu, E. (2012). Higher-order attribute
semantics of flat declarative languages. Computing
and Informatics, 29(2):251–280.
Grossschmidt, G. and Harf, M. (2009). Coco-sim–object-
oriented multi-pole modelling and simulation environ-
ment for fluid power systems. part 2: Modelling and
simulation of hydraulic-mechanical load-sensing sys-
tem. International Journal of Fluid Power, 10(3):71–
85.
Kelly, S. and Tolvanen, J.-P. (2008). Domain-specific mod-
eling: enabling full code generation. Wiley. com.
Kent, S. (2002). Model driven engineering. In Integrated
formal methods, pages 286–298. Springer.
Maigre, R., K
¨
ungas, P., Matskin, M., and Tyugu, E. (2009).
Dynamic service synthesis on a large service models
of a federated governmental information system. In-
ternational Journal On Advances in Intelligent Sys-
tems, 2(1):181–191.
Maigre, R. and Tyugu, E. (2011). Composition of services
on hierarchical service models. Information Mod-
elling and Knowledge Bases XXIII, Frontiers in Ar-
tificial Intelligence, 237:110–129.
Manna, Z. and Waldinger, R. (1993). The deductive foun-
dations of computer programming: a one-volume ver-
sion of the logical basis for computer programming.
Addison-Wesley Longman Publishing Co., Inc.
Matskin, M., Maigre, R., and Tyugu, E. (2007). Com-
positional logical semantics for business process lan-
guages. In Internet and Web Applications and Ser-
vices, 2007. ICIW’07. Second International Confer-
ence on, pages 38–38. IEEE.
ACaseStudyofCombiningCompositionalandObject-orientedSoftwareDevelopment
207