Skip to content
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

Document using sub classes to differentiate versions of a resource (and why) #198

Closed
meadsteve opened this issue May 25, 2022 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@meadsteve
Copy link
Owner

meadsteve commented May 25, 2022

So why not have named based injection? TLDR because I want to make it easier to find usages of a thing in tools like IDEs. This can be hard when relying on magic string names.

class Database:
   ...

class PrimaryDb(Database)
   pass

class ReadReplica(Database):
   pass

With this system classes can be explicit about which kind of database access they need in a way that code analysis tools can understand.

@meadsteve meadsteve added the documentation Improvements or additions to documentation label May 25, 2022
@meadsteve
Copy link
Owner Author

This type of issue was relevant for the galaxy project's use of lagom: galaxyproject/galaxy#12931 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant