[API Design] Make LinkHandler public? #1861
Replies: 5 comments 10 replies
-
Thx @stefanseifert for your feedback about the link handler. We discussed with our team the conversations that you initiated: We also considered the PR from @ky940819 to make the link handler an internal interface (before making it public): We would like to proceed as follows:
|
Beta Was this translation helpful? Give feedback.
-
We finally got some time to look into making the
@stefanseifert @kwin @Sai-1D @ky940819 |
Beta Was this translation helpful? Give feedback.
-
@kwin @stefanseifert Thx for your feedback. Based on your comments, I came up with another approach and created a dedicated PR at #2196 using the builder pattern. |
Beta Was this translation helpful? Give feedback.
-
Hi @jckautzmann - any idea by when this will be available core wcm package |
Beta Was this translation helpful? Give feedback.
-
As it seems that we have some agreement on a new public @stefanseifert @kwin @ky940819 It would be great to get your feedback as you've been heavily involved in all the discussions about making the link handler part of the public API. Thx! |
Beta Was this translation helpful? Give feedback.
-
#1818 rises the request to make LinkHandler public, and #1851 provides a PR for it. currently, the LinkHandler is not public for a good reason: it's API was a first draft, and was changed a lot during preparation of the new 3.x components which are not releases for production yet.
the question is: is the current API of the Core Components LinkHandler in a shape to make it public? keep in mind we cannot easily change it's API in a breaking way in the future once it's releases, so we should be quite sure on this. (i've already raised some design questions around the Link interface which also touches the LinkHandler #1853 #1855 #1857 #1859).
some thoughts on the current LinkHandler public API:
getLink
methods return Optional of Link, which itself has a isValid method, discussed in [API Design] LinkHandler.getLink: Optional<Link> redundant to Link.isValid #1855getLink
providing different variants by using different arguments, some of them providing varying number of string arguments. this type of API design is not very flexible when you add new feature in the future, you only can add even more arguments making code that interacts with it hard to read. probably a different approach should be used which is more flexible to be extended in the future with various features - e.g. a builder pattern?resolveRedirects
should not return a "Pair" object - this is very ugly as if you have the return object you always have to look up the API docs what is in left and what is in right. also to be checkedBeta Was this translation helpful? Give feedback.
All reactions