Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Task 3 — Music Festival Management

Objective

Create a model for a music festival.

The system must describe:

  • concerts
  • artists
  • stages
  • equipment
  • staff
  • guards

Some data is created directly in code, while other data must be loaded from external files.

The implementation must then connect these data sources and provide information about the people and equipment related to a specific concert and stage.

Domain Overview

The main relationships are:

        Artist
           |
        Concert
           |
        Stage
           |
        Equipment
        
        Stage
        ├── Staff
        └── Guards

A concert references both an artist and a stage.

A stage references equipment.

Staff and guards are assigned to stages.

Concert

Each concert contains:

  • ID
  • Day
  • Stage ID
  • Timeline
  • Artist ID

A possible model is:

type Concert struct {
    ID       string
    Day      int
    StageID  string
    Timeline time.Time
    ArtistID string
}

Artist

Each artist contains:

  • ID
  • Name

For example:

type Artist struct {
    ID   string
    Name string
}

Stage

Each stage contains:

  • ID
  • Name
  • Equipment ID

For example:

type Stage struct {
    ID          string
    Name        string
    EquipmentID string
}

Equipment

Each equipment record contains:

  • ID
  • Mix Desk

The mix desk represents the equipment used for mixing concert sound.

For example:

type Equipment struct {
    ID      string
    MixDesk string
}

Staff

Staff represents technical personnel working on the festival.

Each staff member contains:

  • ID
  • First Name
  • Last Name
  • Stage ID
  • Team
  • Position

A possible model is:

type Staff struct {
    ID        int
    FirstName string
    LastName  string
    StageID   string
    TeamID    string
    Position  string
}

Technical Positions

Supported technical positions are:

  • Video-E
  • Audio-E
  • SpecialEffects-E
  • Video-T
  • Audio-T
  • SpecialEffects-T

Their meanings are:

        Video-E          -> Video Engineer
        Audio-E          -> Audio Engineer
        SpecialEffects-E -> Special Effects Engineer
        
        Video-T          -> Video Technician
        Audio-T          -> Audio Technician
        SpecialEffects-T -> Special Effects Technician

A typed representation is recommended instead of unrestricted strings.

For example:

type StaffPosition string

with predefined allowed values.

Guard

Each stage also has guards.

A guard contains:

  • ID
  • First Name
  • Last Name
  • Stage ID
  • Team ID
  • Sector

For example:

type Guard struct {
    ID        int
    FirstName string
    LastName  string
    StageID   string
    TeamID    string
    Sector    string
}

Static Artist Data

Create a separate module containing the following artists:

[]Artist{
    {
        ID:   "1",
        Name: "Coldplay",
    },
    {
        ID:   "2",
        Name: "Nightwish",
    },
    {
        ID:   "3",
        Name: "Protoculture",
    },
}

Static Equipment Data

Create the following equipment records:

[]Equipment{
    {
        ID:      "1",
        MixDesk: "Soundcraft Vi3000",
    },
    {
        ID:      "2",
        MixDesk: "Allen&Heath SQ-7",
    },
    {
        ID:      "3",
        MixDesk: "Midas M32 Live",
    },
}

Static Stage Data

Create the following stages:

[]Stage{
    {
        ID:          "1",
        Name:        "Blue",
        EquipmentID: "1",
    },
    {
        ID:          "2",
        Name:        "Red",
        EquipmentID: "2",
    },
    {
        ID:          "3",
        Name:        "Green",
        EquipmentID: "3",
    },
}

Concert Data Source

Concert data must be stored in a separate YAML file.

Example:

- id: "1"
  day: 1
  stageID: "1"
  timeline: "2019-11-27T18:00:00Z"
  artistID: "1"

- id: "2"
  day: 1
  stageID: "2"
  timeline: "2019-11-27T18:00:00Z"
  artistID: "2"

- id: "3"
  day: 1
  stageID: "3"
  timeline: "2019-11-27T18:00:00Z"
  artistID: "3"

The implementation must:

  1. read the YAML file
  2. parse every concert
  3. convert the file data into the concert model

Guard Data Source

Guard data must be stored in a separate JSON file.

Example:

[
  {
    "id": 601,
    "firstName": "Paul",
    "lastName": "Hoffman",
    "stageID": "1",
    "teamID": "1",
    "sector": "1"
  },
  {
    "id": 602,
    "firstName": "Eliot",
    "lastName": "Page",
    "stageID": "1",
    "teamID": "1",
    "sector": "1"
  },
  {
    "id": 611,
    "firstName": "Darius",
    "lastName": "Shaw",
    "stageID": "1",
    "teamID": "1",
    "sector": "2"
  },
  {
    "id": 612,
    "firstName": "Freddie",
    "lastName": "Hoffman",
    "stageID": "1",
    "teamID": "1",
    "sector": "2"
  }
]

The implementation must:

  1. read the JSON file
  2. parse all guards
  3. convert them into guard models

Staff Data Source

Staff data must be stored in a separate CSV file.

The source uses semicolon-separated values.

Example:

401;David;Hill;1;1;Video-E
402;Alex;Grant;1;1;Video-E
403;Jason;Milles;1;1;Video-T
404;Zak;Walker;1;1;Video-T
405;Luke;Jackson;1;1;Video-T
201;Samanta;Russo;1;1;Audio-E
202;James;Hawkins;1;1;Audio-E
203;Rhona;Davidson;1;1;Audio-T
204;Wade;Atkinson;1;1;Audio-T
205;Norma;Bender;1;1;Audio-T
801;Lillie;Wood;1;1;SpecialEffects-E
802;Paul;Russell;1;1;SpecialEffects-T

The expected field order is:

  • ID
  • FirstName
  • LastName
  • StageID
  • TeamID
  • Position

The implementation must:

  1. read the CSV file
  2. use ; as the delimiter
  3. parse every staff record
  4. convert the data into staff models

Data Relationships

The implementation must connect the loaded data using IDs.

Concert to Stage

Concert.StageID
    ↓
Stage.ID

Concert to Artist

Concert.ArtistID
    ↓
Artist.ID

Stage to Equipment

Stage.EquipmentID
    ↓
Equipment.ID

Staff to Stage

Staff.StageID
    ↓
Stage.ID

Guard to Stage

Guard.StageID
    ↓
Stage.ID

Required Query

For a specific concert and its stage, the implementation must provide information about:

  • staff working on the stage
  • equipment used on that stage
  • guards working on that stage

The concert itself can be used to resolve the stage.

Conceptually:

        Concert
           ↓ StageID
        Stage
           ↓ EquipmentID
        Equipment
        
        Stage
        ├── Staff
        └── Guards

Suggested Result Model

A structured result may be used:

type ConcertStageReport struct {
    Concert   Concert
    Artist    Artist
    Stage     Stage
    Equipment Equipment
    Staff     []Staff
    Guards    []Guard
}

This is not required by the source, but it is a useful representation of the requested joined data.

Example Resolution

For:

Concert ID = 1

the concert references:

StageID = 1
ArtistID = 1

The stage is:

Blue

The artist is:

Coldplay

The stage references equipment:

EquipmentID = 1

which corresponds to:

Soundcraft Vi3000

Staff with:

StageID = 1

must be included.

Guards with:

StageID = 1

must also be included.

Data Validation

The implementation should detect broken references.

For example:

Concert.StageID does not exist
Concert.ArtistID does not exist
Stage.EquipmentID does not exist

These relationships are required for the requested data resolution.

File Errors

The implementation should also distinguish errors such as:

file not found
invalid YAML
invalid JSON
invalid CSV
invalid field value
unknown technical position

The exact error representation is left to the implementation.

Requirements

The implementation must:

  1. model concerts
  2. model artists
  3. model stages
  4. model equipment
  5. model staff
  6. model guards
  7. define all supported technical positions
  8. create the provided artist list
  9. create the provided equipment list
  10. create the provided stage list
  11. load concerts from YAML
  12. load guards from JSON
  13. load staff from semicolon-separated CSV
  14. resolve a concert’s stage
  15. resolve the artist
  16. resolve the stage equipment
  17. return all staff working on the stage
  18. return all guards working on the stage

Modeling Goal

The main challenge is joining information that originates from several independent data sources.

Conceptually:

            YAML
             |
          Concert
         /       \
     Artist      Stage
                  |
               Equipment
              /         \
            Staff       Guards
             |            |
            CSV          JSON

The implementation should avoid duplicating information across models.

IDs should be used to connect related entities.

Optional Extension

Possible extensions include:

  • multiple concert days
  • staff shifts
  • equipment replacement
  • guard teams
  • sector-level guard queries
  • stage scheduling conflicts
  • artist scheduling conflicts

These features are not required by the original task.

Scalionix Docs

Keyboard Shortcuts

Navigate the documentation without leaving the keyboard.
Navigation
Previous subject
←
Next subject
→
Previous subsection
Alt + ↑
Next subsection
Alt + ↓
Interface
Documentation Home
Ctrl + Enter
Search
Alt + Q
Open shortcuts
?
Close dialog
Esc
Scalionix Docs

Search Documentation