So I'm building my first application, in Python, and some issues have cropped up because of the lack of interfaces (I.e. explicit type declaration)
My design involves several homebrew packages, and I've been taught to reduce coupling by using a controller class for package access. Here's an incomplete class diagram - some of the controllers haven't been made yet, but the intention is to associate all classes through their respective controllers.
The problem is that this reduces cohesion, with the controller interface replacing the services provided by the classes. Now my dilemma is:
- Should all concerned classes from other packages be coupled with the controller, or the internal classes? A mix of both, or exclusively the controller?
- Wouldn't other classes have access to a great deal of behaviours that it shouldn't?
I was thinking of using a factory class, behind some of the controller's methods, to return instances internal to the package - but this would increase coupling.