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

[repository] provide a RepositoryReference interface to find out the repository of a Resource #664

Open
laeubi opened this issue Jan 21, 2024 · 2 comments
Assignees

Comments

@laeubi
Copy link
Contributor

laeubi commented Jan 21, 2024

If a Resource originates from a Repository it is sometimes useful to find other Resource from that.

Adding a RepositoryReference interface a resource can optionally implement would allow to discover the originating repository.

@timothyjward
Copy link
Contributor

Why would we need a new interface? We could add this method to RepositoryContent, which already exists to mark a resource as having come from a repository.

@laeubi
Copy link
Contributor Author

laeubi commented Jan 23, 2024

I have seen RepositoryContent more as a way to access the stream of bytes and even if the javadoc says that all Resource from a repository must implement this I can see cases where a Resource exits in a repository but has no "real" content, but if it is easier RepositoryContent can be enhanced of course.

One thing that came into my mind was that e.g. Bundle and similar has an adapt(...) method, maybe one should have such one for Resource as well, then it could be provided by adaption pattern to get access to the repository (and maybe other objects as well) without new interface. This would even allow more flexibility in discover internal representations as well.

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