list of dots Digital Research Alliance of Canada logo  NSERC logo  University of Ottawa logo / UniversitĂ© d'Ottawa

User Manual    [Previous]   [Next]   

Airline System

A simple airline system that manages flight and passenger information

Example

// Airline system - sample UML class diagram in Umple
// From Book by Lethbridge and Laganiere, McGraw Hill 2004
// Object-Oriented Software Engineering: Practical Software Engineering using UML and Java
// See https://www.site.uottawa.ca/school/research/lloseng/

namespace Airline;

class Airline{
  1 -- * RegularFlight;
  1 -- * Person;
}

class RegularFlight{
  Time time;
  unique Integer flightNumber;
  1 -- * SpecificFlight;
}

class SpecificFlight{
  unique Date date;
}

class PassengerRole
{
  isA PersonRole;
  immutable String name ;
  1 -- * Booking;
}
  

class EmployeeRole
{
  String jobFunction ;
  isA PersonRole;
  * -- 0..1 EmployeeRole supervisor;
  * -- * SpecificFlight;
}

class Person
{
  settable String name;
  Integer idNumber;
  1 -- 0..2 PersonRole;
}

class PersonRole{}

class Booking{
  String seatNumber;
  * -- 1 SpecificFlight;
}

class Airline {
  // Sample output to illustrate manipulating the model
  depend java.sql.*;
  public static void main(String [] argc) {
    Airline a = new Airline();
    RegularFlight f100 = new RegularFlight(
      Time.valueOf("10:15:00"),100,a);
    SpecificFlight f100jan4 = new SpecificFlight(
      java.sql.Date.valueOf("2025-01-04"),f100);
    System.out.println(f100);
    System.out.println(f100jan4);
  }
}

      

Load the above code into UmpleOnline