vendredi 20 mai 2022

Naming a subclass to store requirements of the parent class

I have the class Party and inside i have some restrictions to join that party.

Looking like this:

class Party {
    String id;
    String name;
    Instant date;
    Requirement requirement;
}

class Requirement {
    int age;
    String dressCode;
    boolean drinkIncluded;
    ....
}

My question is: How should i name the subclass Requirement? I came up with three options but i cannot tell what is the best naming convention.

  1. Requirements (in plural)

  2. Requirement (in singular)

  3. Requirements_configuration

Is there some design pattern that i am missing to solve this or i just can name it in plural in this scenario?

Aucun commentaire:

Enregistrer un commentaire