javaumlinterpreterutilities

Should I represent a Java utilitary class in UML?


My text editor has three classes which are Buffer, Command and CommandInterpreter. Buffer and Command are oriented object classes but CommandInterpreter contains only static method and is used to create an instance of Command and to execute these command.

My question is should I represent CommandInterpreter on my classes' diagram or should I just represent Command and Buffer since CommandInterpreter contains only static method?

Thanks in advance!


Solution

  • It depends what you want to show with your UML

    1. Show the object oriented design of the problem (than the CommandInterpreter is not needed)
    2. Documentation of the whole system (in this case i would add the CommandInterpreter because otherwise something is missing)

    I would prefer to add the CommandInterpreter (maybe with a short note as description). Also the stereotype <<utility>> can be used for classes which have only static methods.