@startuml skinparam class { backgroundColor<> LightGray backgroundColor<> Gray } set namespaceSeparator :: namespace Commands { class OptionDefinition { Defines one command line option, wrapping around slop features. +{method}:to_slop_options } class SubCommand { Represents a a-la-git sub-command .. +{field}name } class MainCommand << (M, #ADD1B2) module>> { Represents the main command. Basically a Subcommand but with an empty name. .. } class Factory << (M, #ADD1B2) module>> { How to create a SubCommand from a definition hash. .. +{method}:from_hash } class HelpFormatter << (M, #ADD1B2) module>> { Builds help for a command. .. +{field}help_template +{method}:help } class Validation << (M, #ADD1B2) module>> { Checks the validity of options defined. .. +{method}:valid? } class CommandLineParser <<(M, #ADD1B2) module>> { Parses command-line .. +{field}cmd_line_args +{method}:extra_arguments +{method}:params_hash } SubCommand "1" *-- "n" OptionDefinition : "contains\nand\ncreates" SubCommand -|> Factory : extends SubCommand --|> HelpFormatter : includes SubCommand -|> Validation : includes SubCommand --|> CommandLineParser : includes MainCommand ..|> SubCommand : "included\nfor main command\nat runtime" } namespace Manager { class Base { Manages completely the list of options definition and how to find a processor for a list of command line parameters } class LayeredDefinition <<(M, #ADD1B2) module>> { Wrapper around SuperStack::Manager to manage "contributions" to the definition with cache management. .. +{method}:definition_hash +{method}:contribute_to_definition +{method}:[]= } class ProcessorMatcher <<(M, #ADD1B2) module>> { Determines a suitable list of potential processors from the command-line parameters .. +{method}:candidates } class Commands <<(M, #ADD1B2) module>> { Manages a main command and optionally sub commands. .. +{field}commands } class Factory <<(M, #ADD1B2) module>> { How to create a Manager from a definition hash. .. +{method}:from_hash } Base -|> ProcessorMatcher : includes Base ---|> LayeredDefinition : includes Base --|> Commands : includes Base --|> Factory : extends } namespace Processors { class Base class Registration<<(M, #ADD1B2) module>> Base -|> Registration : includes } namespace Utils { class BasicLogger<<(M, #ADD1B2) module>> class ErrorPropagation<<(M, #ADD1B2) module>> class YamlFactory<<(M, #ADD1B2) module>> { If your module or class implements #from_hash, then including this module will bring the ability to load it from a yaml string or a yaml file. .. +{method}:from_yaml +{method}:from_yaml_file } } Manager::Commands "1" *---- "n" Commands::SubCommand : "contains\nand\ncreates" Manager::ProcessorMatcher "0" *- "n" Processors::Base Manager::Factory -|> Utils::YamlFactory : includes Commands::Factory -|> Utils::YamlFactory : includes Manager::Base -|> Utils::ErrorPropagation : includes Commands::SubCommand --|> Utils::ErrorPropagation : includes @enduml