Search code examples
classoopumlassociationsooad

UML class diagram about relationship types in project management


I'm trying to draw an class diagram for my project management software describing the following. It contains the following classes:

  • Project - software projects
  • ProjectManager - he/she who manage the project
  • Employee - people who are engage in project work

and the following relationships/associations:

  1. a project manager may have to manage more than one project, while a project can only be managed by one project manager

  2. a project manager can assign an employee to a project that he/she manages

For the above associations I created this class diagram:

enter image description here

  • It's clear how to model the first association (between ProjectManager and Project)
  • I have no idea how to model the second association
    (how to implement that a project manager is only able to assign projects to employees that he is responsible to manage ?)

Solution

  • You just add an operation to Project called assignEmployee which will add the employee to its list of assigned employees:

    enter image description here

    It's unclear how an employee can be assigned, whether to just one or multiple projects. Also you will likely need a de-assign operation.

    Of course you can also use an association class like suggested by @WolfgangFahl.