The Car Rental System sample application

The car rental system application is one of multiple samples showing what you can do with AndroMDA. In order to get the sources for this sample you are required to download an AndroMDA 3.x distribution.

The model has been designed using the Poseidon case tool. You will find the model inside this file. Open and view this model with Magic Draw's community edition, which can be downloaded from No Magic's web site. Although Poseidon CE is free, not everybody has installed it. Therefore, we have used Poseidon PE to generate an HTML/JPEG representation of the car rental system sample model browsable as HTML.

The Model

The model consists of a package with use cases, explaining what the main actors (users) of the application might be and what they can do with the system. The main actors are an administrator who creates things like cars and types of cars, a customer who reserves cars for certain dates, and a call center who can reserve cars as well as record car accidents. Last, but not least, there are car loan and reception desks who do what their names imply. :-) Each use case has an activity diagram attached to it which explains the message flow of that particular use case.

The rest of the model contains all the design level packages with the class diagrams inside. The design level packages are admins, contracts, customers and inventory.

The Implementation

This sample was generated using the following cartridges:

Tier Technology Cartridge
Persistence (Entity Beans) and Business (Stateless Session EJBs) EJB 2.0 (Stateless Session and Entity EJBs) andromda-ejb-cartridge
Presentation Struts 1.2.4 andromda-bpm4struts-cartridge

Building and Deploying

To build the car rental system, just cd to the andromda distribution's samples/car-rental-system directory and type maven, this will build both EJB and Hibernate versions of the application. You will find the deployable ear file located in samples/car-rental-system/app/target.

This ear files can be deployed within a JBoss application server instance (like any typical J2EE application) by dropping the ear files within your $JBOSS_HOME/server/default/deploy directory.

Because the application uses the HypersonicSql Database bundled with JBoss, you'll need to make sure you have JBoss running before attempting to deploy the application.

Using

Once the car rental system has been successfully deployed within JBoss (i.e. no exceptions), point your browser to http://localhost:8080/car-rental-system.

You may now begin to explore the application:

  1. Login as an administrator
  2. Create things such as car types, cars and customers
  3. Logout
  4. Login as a customer and reserve the cars created from step 2 car(s) for certain date(s).
  5. Finally, you may start a JDBC browser to have a look at the database tables with their beautiful CMR relationships in the disguise of foreign keys

When you log in as administrator for the first time, the system will prompt you for a new username and password. Please memorize these for the next time you log in.