Escolar Documentos
Profissional Documentos
Cultura Documentos
without MDA
A lightweight approach to MDD
Javier Paniza
Introduction
A notable problem of Java Enterprise Development is its inherent complexity.
Either if you use Java EE standard or Spring, your development team will never
be as productive as a VisualBasic, PHP, Ruby&Rails, 4GL or even COBOL
development team. Complexity of Java Enterprise requires very skilled
developers, moreover these developers need to write a lot of code.
The ideal solution for this problem could be the Model-Driven Development
approach. Basically MDD states that just the model part of an application has to
be developed, and the rest of the application will be generated from this model. In
this way, the developers write less and simpler code, nevertheless a powerful
Java Enterprise Application is created.
However, for today, the MDD usage is still very complex. It's needed to make a
big investment of time, expertise, and tooling; usually building your own DSL's
and combining them into a software factory, and it costs a lot of effort. Therefore,
only big companies can afford MDD, and it can only be paid back when using it
multiple times for different projects. And, of course, MDD is a hard alternative for
mid-size and small companies.
Fortunately you can enjoy the goodness of MDD without its pains. Just removing
MDA, DSLs, UML and code generation from MDD and you'll obtain a simple but
effective way to do Model Driven Development.
9000
8000
Java
7000 VB
C#
6000 PHP
C++
5000 Ruby
Cobol
4000
3000
2000
1000
But the Java world is not so wonderful. The little sin of Java technology for
enterprise is its complexity. It's not easy to have something powerful and flexible,
and simple and easy at once. Although big efforts have been done to simplify
Enterprise Java, it is still very complex. Note the Richard Monson-Haefel's
comment about Java 5 EE 2 3:
The invariable promise of MDD is complexity reduction, for example an IBM white
paper7 says about MDD:
Is MDD cheap?
Let's examine the most popular MDD incarnation, MDA. The idea behind MDA is
explained in its official site in this way8:
So, you have 3 steps, develop a PIM, transform it to a PSM and then transform to
the final implementation. Undoubtedly, it is a more complex approach to software
development than the agile one: “write code, obtain product”. More complexity
involves more tools (to learn, or to develop) and skilled people in these tools and
technology; and also it's difficult to find developers with ability in MOF, PIM, PSM
and all this MDA stuff 9.
This way could be simpler than using MDA, but it's not cheaper because you
have to design the languages and to develop the transformation and code
generation tools, obviously this is costly in money and time. Moreover, standard
tools to work with these languages (as editor or debugger) are not available.
Of course, MDD is not cheap and, in consequence it's out of the scope of mid-
size and small companies, and even large companies need to reuse their MDD
assets several times in order to obtain the return of the inversion.
Fortunately, a simpler way for using the Model-Driven idea has been developed
and used by part of the “developers community” in the last years. This lightweight
model-driven development allows to use the already available tools, language
and developers to do MDD with all its productivity, but with no extra cost.
Is MDD agile?
“Let me change this. That doesn't look right; let me change it again. That's better”
The above sentence has the essence of the “Agile Development”. We have not a
carefully upfront design, defined sequential steps (analysis, design, programming,
testing, etc), abundant documentation, well defined roles (analyst, programmer,
tester, etc), etc. Nothing of that. Instead we have an executable product, albeit
simple at first, and we change and release it frequently.
Agile methods have become very popular nowadays 11. In order to be used a
“development technology” must allow you to do changes and see the effect of the
changes fast. Is MDD ready for that?
In MDD you have models (UML, DSLs) that generate code. If a change is
required, like a class refactoring, you need to change the model and to
regenerate code. Also it's typical to touch the generated code in order to achieve
the desired changes. That is, you need time and effort to do changes even using
a good round trip tool.
With agile methods we try to achieve a creative process around the executable
product and with the direct user feedback. If the developer has to wait several
minutes to do an incremental change and see the result of it, then the
concentration is broken, and the creative process is disrupted 12.
Is it possible to be agile with MDD? Of course. But code generation and using two
types of artifacts (DSL/UML and Java) do not help. Nevertheless, we can remove
DSL and code generation and still use MDD and be more agile at once.
However, creating business applications in the 1990s using OOP was not so
easy. A lot of things as CORBA, EJB, MVC or UI development added complexity
to OO development.
In the 2000s Model-Driven Development arose as an idea to simplify all this, but it
still has its own complexity.
This way, writing Java classes for Invoice, Customer, Product, Order, etc. with the
appropriate metadata is enough to obtain a working application. The user
interface, database access, behavior for common task and so on are done
● Reduce cost, because you can concentrate in the logic of your application,
not in developing DSLs, code generators and so on. You can be
productive from the first day.
○ Fewer steps are needed to write the code to obtain the running
application.
● Obtain richer applications, because usually the LMD frameworks are very
optimized and produces high quality applications.
● Migrate already existing code, because they use Java classes with Java
standard annotations, and not proprietary DSLs, a big part of our current
code is already ready to be used with a LMD.
● Delivery our current developers skills, because the core of the application
is plain Java classes.
High productivity of MDD with low cost: Possible for small companies, cheaper
for the bigger ones.
Be sure that it is Lightweight: The core of the application must be simple Java
classes (POJOs). It must not require UML. It must not use DSLs or code
generation. Most part of the application, including the User Interface, has to be
provided automatically.
Standard Java: Look for a solution that uses standard Java for the source code,
Open Source: The ideal solution should be open source in order to obtain a
better flexibility. Can you improve the code of the framework and contribute back?
Does the project accept contributions in a shared intellectual property way? Does
its license allow you to develop commercial applications?
Mature project: Look for a project with several years since its first stable version,
at least 50.000 downloads, active public forums (100 messages/month),
exhaustive documentation in several languages (not just in English), etc.
OpenXava
OpenXava is a mature Lightweight Model-Driven Framework focused on
productivity and flexibility. It allows developers to write less and simpler code, but
at the same time it is flexible enough to face any case you can find in a business
application.
This effectiveness is possible because OpenXava has been used and refined for
years to create enterprise applications with Java just by the same developers that
use it. In fact, it's a LGPL (so it's possible to create commercial applications)
project with more than 30 contributors around the world and an active and
growing community.