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

Question about extendability #244

Open
repl6669 opened this issue May 11, 2023 · 0 comments
Open

Question about extendability #244

repl6669 opened this issue May 11, 2023 · 0 comments

Comments

@repl6669
Copy link

repl6669 commented May 11, 2023

Hello @lindyhopchris, first of all I would like to thank you for all the work you've put into this project, it is brilliant and nicely written.

I am currently building an API layer for a headless ecommerce store which consists of multiple packages all dealing with separate concerns. The initial thought was that there will be a core and then additional modules which add specific functionality.

There are at least 3 levels:

  • Core API package
  • Multiple other packages building on top of that
  • User application adding functionality on top of that

However, some of them need to extend already existing schemas, resources and so on. I spent long hours code diving, trying to figure out a way how to extend the base classes and ended up with writing singleton manifests in order to at least be able to compose the array return value of Schema public methods in order to make them extendable.

To make it less abstract, here is some code:

Current solution works, but it does not feel clean and it is somewhat inconvenient to have to call ...parrent::someMethod() in every single extendable schema plus there is no way to enforce it with a contract and so on.

If possible, could you please suggest a better approach to address this issue?
Thank you very much.

@repl6669 repl6669 changed the title Extendability Question about extendability Feb 9, 2024
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

1 participant