Getting Started

Requirements

  • Mdarad-Genapp

    This is what will help you generate your development environment and put everything into place

    Latest Release:mdarad-genapp-v2.zip

  • 3rd Party Products (3PP)

    There are many 3rd Party Product libraries and tools used by MDARAD. We try to stay up to date with the latest versions. For many of the 3PP, there are configurations to be made. Please have a look at MDARAD's environment 3PP Configuration (PDF or ODT) to configure your 3PP properly.

    • JDK

      MDARAD runs on Java. You will therefore need to get a working JRE.

      Currently used release: JDK 6 Version 5

    • ANT

      ANT is a "make" tool. It is what helps build, compile and deploy the applications and generate the development environments.

      Currently used release: Ant 1.7.0

    • JBoss AS

      JBoss is the Application Server. This is where you deploy the application once you have built it.

      Currently used release: Jboss 4.2.2

    • Apache Web Server (Optional)

      It is possible to put Apache in front of JBoss to handle static requests (in order to zip static files on send and other such optimizations)

      Currently used release: Apache 2.2.8

    • Poseidon

      Poseidon allows to model UML diagrams such as class diagrams. This is the preferred tool to work with MDARAD

      Currently used release: Poseidon 3.2

    • MYSQL

      MYSQL is the preferred RDBMS (database) to use with MDARAD. Although it is possible to use other databases with MDARAD, we test and develop with MYSQL.

      Currently used release: MySQL 5.x

Steps to Follow

1- Generate development environment

In every development team, when a new project or application is to be put in place, a development environment needs to be set up. This environment will allow the developers to build, deploy and test the environment. Ideally you want such an environment to be as "generic" as possible so that when a new developer comes around, he can easily start working with the application on his own environment.

Instead of having to setup this environment for each project, mdarad-genapp allows you to easily configure your application and generate its development enviroment.

To do so:

  • Download the latest mdarad-genapp version or fetch the SVN trunk version (recommended)
  • Unzip the mdarad-genapp in a directory of your choice
  • Copy the default.properties file in a file name build.properties
  • Modify the build.properties file to match your project needs. As you'll see, by default the application is the totaltest application which is a sample application of the mdarad-genapp tool. You simply need to modify all the properties to your needs and demands (you'll be able to modify this information later on)
  • Launch the ant task: genapp (i.e. ant genapp)

Your development environment should now be created in the application.base.dir which you selected in the build.properties file

Here is a brief description of the development environment created

  • build
    • <self>

      Contains the build.xml files and the properties files for your project

      It is from this directory that you will launch your ant tasks (in order to compile, deploy, test, etc.)

      build.xml: contains all the ant tasks for your application

      default.properties: contains the necessary properties for the ant tasks (these were generated with what was included in your mdarad-genapp/build.properties)

    • lib

      Contains all the necessary libraries to build your application (from ant extensions, to xdoclet, to andromda, to junit, selenium, etc.

    • rsrc

      Contains necessary resources to build the application

  • lib
    • Contains all runtime libraries. These librairies will be deployed with the application in order for it to work on runtime
  • srcTemplates
    • Contains all the sources that are used by the application but that are not generated (these are the same from project to project....they are independent of the underlying application)

2- Model

The next step is to model your desired application by creating its UML Class diagram

You should start your model from the startTemplate.zuml found under mdarad-genapp/startTemplates/uml. This template contains the datatypes and stereotypes that you can use with MdaRAD

There are partial models that you can import in your application model.

  • authentication.zuml: This package contains the authentication classes (such as LoginRole, LoginUser, etc.). They have particular stereotypes for authentication and authorization purposes. This model is already included in the startTemplate.zuml. If you wish to modify these classes in your model, you need to follow the same logic (stereotypes and links)
  • primitives.zuml: This package contains the stereotypes and the dataypes necessary for the modelization with MdaRAD. This model is already included in the startTemplate.zuml
  • contact.zuml: This package contains classes needed for contact information such as addresses, cities, countries, phone numbers, emails, etc. This package is NOT included in the startTemplate.zuml

There are certain rules that must be followed in order to model your application:

  • You must use the dataisland primitive datatypes for your data types (i.e string, float, integer, etc.). These datatypes are found in the org.dataisland.primitives.datatype package (see http://dataisland.org/project/primitives/doc/usermanual/ for full list of datatypes)
  • You should use the Entity stereotype on all the classes that you wish to persist
  • You can use other stereotypes such as Localizable, Unique or Required on attributes (see http://dataisland.org/project/primitives/doc/usermanual/ for full list of stereotypes)

Once you have created your model, save it under <application.base.dir>/doc/uml. The name of your file (without the .zuml extension) should match the property "mode" of your properties file

3- Compile and Deploy

Now that you have your development environment and your model, you can create its corresponding web application

To do so:

  • Launch the ant task: deploy.all from the <application.base.dir>/build directory (i.e ant deploy.all)
  • Create an empty schema and user for your database. If using mysql from the command line:
    • Login to mysql command line: mysql -u root -p
    • Create the database by doing: create database <schema name>;
    • Create the user for your database: grant all privileges on lafrance.* to <db.user>@localhost;
  • Create the database tables from your application model. Launch the ant task: create.tables (i.e. ant create.tables)
  • Initialize the database with generic information. Launch the ant task: init.sql (i.e. ant init.sql)

Once this step is done, you will have generated the application, deployed it in the application server (i.e. JBoss) and created the database for it

4- View

Start your application server. In JBoss this is done by going to <jboss.home.dir>/bin/run.bat or run.sh

Open your browser and browse to: http://localhost:8080/<application.name>/index.do

That'ts it! Now you should be able to create "entities" of your different classes, modify, view or delete them.