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

create_opfshould provide which type of OpenPecha object should be created #225

Open
10zinten opened this issue Dec 21, 2022 · 1 comment

Comments

@10zinten
Copy link
Collaborator

since, we have separated git logic from OpenPechaFS into OpenPechaGitRepo with #224 the create_opf should be flexible enough to return any type of OpenPecha variant.

Suggestions

  1. Class dependency injection

Cons:

  • no code completion with modern code editor
def create_opf(self, ..., pecha_class: OpenPecha):
    pecha = pecha_class(metadata=metadata)
    ...
    return pecha
  1. Object dependency injection

Cons:

  • no code completion with modern code editor
def create_opf(self, ..., pecha: OpenPecha):
    ...
    return pecha
@10zinten 10zinten changed the title [Bug] create_opf should provide which file type of pecha we should be created create_opfshould provide which type of OpenPecha object should be created Dec 21, 2022
@eroux
Copy link
Contributor

eroux commented Dec 21, 2022

I like the object dependency injection better

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

No branches or pull requests

2 participants