|
class BaseService: |
|
def __init__(self, name, parameters): |
|
self.name = name |
|
self.parameters = parameters |
|
|
|
def execute(self, input_data): |
|
raise NotImplementedError("Subclasses must implement the execute method.") |
|
|
|
|
|
class ServiceOne(BaseService): |
|
def __init__(self): |
|
parameters = { |
|
"Parameter 1": None, |
|
"Parameter 2": None |
|
|
|
} |
|
super().__init__("Service One", parameters) |
|
|
|
def execute(self, input_data): |
|
|
|
output_data = f"Service One executed with input: {input_data}, Parameters: {self.parameters}" |
|
return output_data |
|
|
|
|
|
class ServiceTwo(BaseService): |
|
def __init__(self): |
|
parameters = { |
|
"Parameter A": None, |
|
"Parameter B": None |
|
|
|
} |
|
super().__init__("Service Two", parameters) |
|
|
|
def execute(self, input_data): |
|
|
|
output_data = f"Service Two executed with input: {input_data}, Parameters: {self.parameters}" |
|
return output_data |