MarketSquare / robotframework-ai

Apache License 2.0
10 stars 2 forks source link

Quality: use dependency injection for supplying the AI_Interface to each module #18

Open StijnDeJong opened 1 month ago

StijnDeJong commented 1 month ago

At the moment the Module abstract class creates an AI_Interface on initialization. With three different module, three AI_Interface instances will be created. This is unnecessary as there are no special configurations per module for the AI_Interface; they should all use the same instance. Instead this instance should be initialized before creating all module instances and pass it as a parameter when creating those module instances. This will not only reduce the memory usage (no three instances of the same class) as well as all other benefits dependency injection provides.