Understanding new tools and technologies can be a daunting task, and AndroMDA is no exception. This tutorial serves as a gentle introduction to the power of AndroMDA. We will show you step-by-step how to set up your development environment and build your first Java application. Instead of mechanically going through a series of steps, we will focus on ideas and concepts. Armed with this knowledge, you will be ready to take on real world challenges. Please set aside half a day of quality, uninterrupted time to learn AndroMDA, as there is lot to learn. Then, brew a good cup of coffee and immerse yourself in the wonderful world of Model Driven Architecture.

What is AndroMDA?

AndroMDA (pronounced "Andromeda") is an extensible generator framework that adheres to the Model Driven Architecture (MDA) paradigm. It transforms UML models into deployable components for your favorite platform. While AndroMDA ships with cartridges that can generate code for several platforms and technologies, this tutorial will focus on generating a Java application.

AndroMDA Architecture

The paragraph above might have sounded like a lot of acronyms and marketing speak, but using AndroMDA means one main thing:write less code. Not only that, AndroMDA also lets you create better applications and maintain order on large projects. AndroMDA enforces best practices and lets developers focus on high level problems instead of wasting time on repetitive plumbing code. Additionally, AndroMDA can generate highly customized enterprise quality code to meet your project's very special needs.

During development of large applications, most architects and developers already create class diagrams and data diagrams. These diagrams are usually made in tools like Visio, and the resulting artifacts are static pictures. When code changes, the diagrams must be updated. With AndroMDA, these diagrams become a living part of your application -- they are used to generate large portions of your application, and hence always reflect the current state of the system. When you need to modify your application, you change the model first, regenerate the code, and then add or update custom code as necessary. Thus, you get a production quality application out of assets that you had to create anyway.

AndroMDA provides several cartridges out-of-the-box. For example, the Hibernate and Spring cartridges generate robust service and data layers for your application. In addition, database schema can be exported to script files to allow the creation of your application's database. There is also an easy way to map your model to an existing schema if your database has already been defined. If you wish to generate custom artifacts from your model, you can write a custom cartridge to accomplish this.

When to use AndroMDA?

AndroMDA is an extremely useful tool, but you should know when to use it.

AndroMDA is a great choice when

  • You are starting a new project, or completely rewriting a layer of an existing application
  • You want to save time by generating as much code as possible
  • You are building an application that stores its data in a database
  • You are already familiar with Apache Maven
  • You are already familiar with UML Modeling tools and want to create more than just pretty pictures.
  • You are already familiar with the implementation frameworks: Spring, Hibernate, EJB3, JSF3, JAX-WS, etc

AndroMDA might not be the best choice if

  • Your application uses an existing database that cannot be easily mapped to an object model (for example, it does not use primary keys and object relationships are not clear)
  • You already have a mature application with existing business objects and the incremental effort to model existing components is too high to provide enough value
  • You have an immature software development lifecycle process: No build automation, continuous integration, test driven development (or even unit testing), or code reuse between projects. Fix that first before you start thinking about model-driven development.

What's Next?

Now that you understand what AndroMDA is and when you should use it, let's review some foundational concepts that form the basis of modern enterprise applications. After reviewing these concepts we will discuss how AndroMDA implements them in the applications it generates. Click here to explore this topic.