-
-
Notifications
You must be signed in to change notification settings - Fork 337
update decoupled-example with abstraction layer #770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR needs some addition work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meta
suffix might give it a wrong impression that this is a metaclass. Let's avoid ambiguous naming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or
See comment above. This way it would be much more clear about implementation specifics of the AggregationService
interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interfaces generally has no __init__
, it's an implementation detail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For such simple app example, I'd move everything into interfaces.py
to keep app structure from bloating.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage report treats pass
as a code. Which never executes for abstractmethod
s.
Hi
The decoupled-example code is good, but it lack one important component of DIP rule (https://www.cs.utexas.edu/users/downing/papers/DIP-1996.pdf)
I mean the "Abstraction" layer which can help make "user" and "photo" compliant to abstract classes of their own and "analytics" depends on these abstract classes, and even for "analytics" can be extracted one abstract class, then for main.py (the top-level service aggregation) can only depend on these three abstract class, finally "ApplicationContainer" is for connecting the embodied containers("user", "photo", "analytics") to main.py.
The update code is better to demostrate DIP rule for developer.
I also update docs part.
Please check.
Thanks.