Create TimeTracker Application
Now that you have your environment setup you can start using AndroMDA in your projects.
This section will guide you through creating the base TimeTracker solution. These
are the same steps you would follow when you are starting your own application.
Please note the TimeTracker completed sample is available here:
Couple of tips before we start:
- Please follow the instructions in this tutorial very carefully and precisely.
take any shortcuts, as doing so will only waste your time. There
is a reason for every step in the tutorial. You will not find any fluff here!
- It is recommended to use the latest version of FireFox or Internet Explorer to read
Create the Solution
- Run Visual Studio 2005
- Create a new blank solution, found underOther Project Types | Visual Studio
Solutions. Name the solutionNorthwind.TimeTracker.
Run the Solution Wizard
- Click the
Run MDA Solution Wizard
to exit the welcome page.
- Accept the default project name of
- Accept the default common project name of
- Accept the default core project name of
- Accept the default checked
Create schema export project
and the default project name of
- Check the
Configure web project
box and accept the default project
name ofNorthwind.TimeTracker.Web. Check the
box and clickNext.
- Accept the default web common project name of
- Verify that your project settings look like the screenshot below, and click
to run the wizard.
- Your solution is now configured for use with AndroMDA. Here is a list of what was
created for you:
directory: AndroMDA configuration files and an empty model. Because we checked membership
support basic user and roles entities were added automatically.
- Northwind.TimeTracker.Web: Web site with nhibernate support
- Northwind.TimeTracker.Common: Common project. This is where AndroMDA
generates value objecst and enumerations
- Northwind.TimeTracker.Core: Core project. This is where AndroMDA
generates entities, nhibernate mappings, services, and data access objects.
Northwind.TimeTracker.SchemaExport: A console application that
will generate database schema from your model. It can optionally export the schema
to a running database.
Northwind.TimeTracker.Web.Common: Project for classes and controls
the web site will use. Because we checked membership support an ASP.NET 2.0 MembershipProvider
that uses the user and role entities was created for us, and the web site is pre-configured
to use it.
Open the UML Model
- Click the
button to open your project's UML model.
- MagicDraw will open and it will automatically load the model that was generated
by the add-in. An initial package structure was created by the add-in using the
name of the solution you selected. Additionally a
some supporting classes were created and added to the model because the membership
support option was selected.
Leave MagicDraw open for now, as we will be adding to the model.
Creating the TimeTracker Database
We need to create a database for TimeTracker to store the timecards. While you can
use any type of database NHibernate supports in your project, this tutorial will
focus on SQL Server 2000, 2005 and MSDE. Here are the steps to creating a database
Creating the Database with SQL Server 2000/2005
- Run Enterprise Manager (2000) or SQL Server management Console (2005)
- Expand your local server (2000) or connect to your local server (2005)
- Right click the Databases folder and select
Create new database
- Enter the database name
Creating the Database with MSDE
- Open a console window by clicking
typingcmd, and clicking Ok.
osql -U sa -P password -S localhost\myinstance
with your MSDE
login credentials and
changed to your instance name.
- Type the following to create a database calledNorthwindTimeTracker:
1> use master
1> CREATE DATABASE NorthwindTimeTracker
The CREATE DATABASE process is allocating 0.63 MB on disk 'NorthwindTimeTracker'.
The CREATE DATABASE process is allocating 0.49 MB on disk 'NorthwindTimeTracker_log'.