CommandFactoryInterface.construct()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 3
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
"""This module is responsible to define an interface to construct Command objects (instances of the Command class)."""
2
from abc import ABC, abstractmethod
3
from .command_interface import CommandInterface
4
5
6
class CommandFactoryInterface(ABC):
7
    """Define a way to create objects of type Command.
8
9
    Classes implementing this interface define a way to construct (initialize) new Command objects (class instances).
10
    """
11
    @abstractmethod
12
    def construct(self, *args, **kwargs) -> CommandInterface:
13
        """Construct a new Command object (new class instance) that can be executed.
14
15
        Returns:
16
            Command: the command object (instance)
17
        """
18
        raise NotImplementedError
19