home‎ > ‎

Objectflow - the first release

posted Feb 21, 2012, 1:38 AM by Daniel Stieger   [ updated Feb 21, 2012, 5:32 AM ]
Instead of discussing language modularization, -composition or -extension in theory, i am going to give you a brief 
glimpse from a practical perspective by pointing out some major aspects of our business-application DSL´s: objectflow and
forms. Both DSL´s were built with jetbrains Meta Programming System. In this blog entry i will focus on objectflow since
we issued the first release of the DSL this week. 

Objectflow builds on the ideas of Eric Evans´ paradigm of domain-driven design (DDD). Any data (entities or value objects
in DDD terms) can be modelled as objectflow business objects  with various attributes and references. For example, an
invoice with invoice positions is modelled as a business object invoice containing a collection of invoice position business
objects. The invoice becomes a so called “root aggregate”, when functionality or operations are added in a dedicated invoice
service. Basically, all necessary functionality has to be put into a service and in turn, the service has to be related to a
business object. Thus, although Objectflow services can be written in plain java, the structure and building blocks of
services are standardized. Particularly this standardization results in more transparency and higher code quality by also incorporating
the flexibility of the java language itself.

 Example of invoice service

Objectflow also takes advantage of a very strong collection language from MPS, which can be applied in services. Building
unions of invoices or summing up a collection of invoices are central operations in business and should therefore be
supported with a very clear and handy syntax. The collection language employed with objectflow provides the means to build 
expressive queries using closures - in a way similar to Microsoft´s LINQ.

The very same high level collection language is also used in objectflow to handle database queries. Objectflow allows the
developer to create a so called “repository” containing various queries for business objects. Instead of generating java code,
SQL queries as well as their mappings to related database table fields with business object properties are generated automatically.
Thus the developer is no longer challenged by technical implementation details like mapping or database querying. 

 Example of database query

Of course, objectflow actively supports test driven development. Developers can create a new executable testsuit - tailored
to test business logic- with just one click. The testsuit contains pretest-data and posttest-data, both described in simple
json-notation. Pretest-data contains necessary data saved in business objects, which gets built and initialized before running a test.
Posttest-data contains expected outcomes which are compared with actual data from the test by posttest-checker methods.
To get a service tested, just shovel some pretest-data into a service and check it after execution with expected results.
In our initial case of invoices, one can test a booking services with a pretest invoice and posttest booking lines. 

 Example of test suit

Feel free to contact me for further explanations. In the forthcomming blog entry, i am going to present some code examples 
and screenshots from the forms DSL. See you soon...