Technical overview - mvsd/futsalpro GitHub Wiki
On this page, we try to sum up the main technologies used in this software product.
EMF metamodel
The core of Futsal Pro is a metamodel defining the participants of a futsal match, and possible events that can occur during the actual game time. This metamodel describes the domain and thus defines the business objects that we use throughout the whole application.
With Eclipse and EMF, one can generate a lot of useful code - among others classes defined by the metamodel, automatic handling of their relationship, an out-of-the-box notification system to keep track of changes made to the actual model elements, and a complete framework for editing and validating models of the metamodel in a ready-to-use Eclipse plugin.
Yakindu statechart
Yakindu is a statechart modelling tool that supports code generation to programmatically use the state machines you create visually. It has a nice graphical user interface with extensive functionality and a capability to simulate the behaviour of the state chart.
It supports the definition of interfaces, which can be used to push events into the system, or subscribe to events raised by it. It also supports interface and internal variables that can be read and written from outside the model or in action expressions in the model itself.
The event and variable system, accompanied by the code generation functionality, makes Yakindu an excellent tool to describe and at the same time implement dynamic functionality, which we use to control the scoreboard screen in the program.
IncQuery patterns
IncQuery is a framework for defining declarative queries over EMF models, and executing them efficiently without manual coding. It can be used to create validations for EMF models to check features that cannot be enforced by the metamodel only, to compute derived features and properties "on-the-fly", or to query a model searching for an arbitrary pattern defined declaratively. IncQuery takes the defined patterns, and compute the matches incrementally, thus always giving up to date results, and to top it all, really quickly.
We use it to validate user operations, for example to check if a player is about to score a goal after a red card, which is not allowed. Another interesting application of IncQuery is the computation of the current field players, because that list is assembled by taking the initial field players, and applying each substitution events up until the current time. This could be done with simple Java code, but with IncQuery, the whole feature takes nothing more that a few lines long pattern definition - and it is still incremental.
Xtend-based report generation
Xtend advertises itself as the "better Java", and it is, indeed, nothing more that Java with a more confortable (but sometime weird) syntax and a few helpful libraries. Still, the syntactic features make Xtend an ideal language to generate code, let it be program code, HTML, or LaTeX.
We also used it to this purpose, namely to generate the HTML and PDF reports of the finished match. The syntactic feature that helps this is really neat - one can easily switch between writing code and writing a string template. This is very comfortable, there is no need to mess with string concatenation, the formatting is easy, and special characters do not mean a problem either.
Eclipse RCP application
RCP (Rich Client Platform) is a stripped Eclipse that can be used to run a standalone application still based on Eclipse features and reuse existing Eclipse plugins. It has a broad spectrum of configurable parameters, and provides an extensible framework to develop on.
We needed to create an RCP application in order to be able to use IncQuery, which is at the moment only works with Eclipse, and does not have a standalone library version. While it is quite hard to get started and find everything, RCP is a platform full of useful and flexible functionality that is a great base for complex Java programs.
Miscellaneous
The application has a feature to load pre-registered data from and Amazon RDS MySQL server. This is done by Hibernate, which is a popular implemetation of the JPA 2 standard. With Hibernate Tools, it is easy to reverse engineer annotated classes out of an existing database, and only a few configuration wizards are needed to get started loading data into the generated classes.
WindowBuilder Pro is a project developed by Google, which aims to provide a WYSIWYG editor for Swing, SWT and GWT, similar to the editors provided by Visual Studio or NetBeans. Visually edited user interfaces are converted into Java code, which should produce the same result when run. While we also used it to create the simple parts of the user interface, some more complex functionalities - such as the dynamic parts of the first screen - had to be coded manually.
We also used the Apache HTTP components, an easy way of handling HTTP-based services, such as the REST service we had to call in the homework.