-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
API structure conventions: inheritance #19965
Comments
@Elchi3 we're moving discussions out of mdn/content - I believe this discussion was resolved, can you confirm? If which case we can keep the discussion locked & archived - thanks! |
I don't think this is resolved yet. I also referred to this discussion from another recent issue but I guess the moving around of things breaks those links, too. |
Thanks @Elchi3 - can we unlock and unarchive the discussion @schalkneethling As far as the broken links go I think that's something for github |
Discussion unlocked and unarchived 👍 mdn/mdn-community#205 |
Discussed in https://github.com/orgs/mdn/discussions/205
Originally posted by Elchi3 January 6, 2021
We probably discussed this already somewhere but I'm opening a new issue here.
(I'm also thinking about mix-ins but I figured it might be easier to make a call on simple inheritance structures first.)
I'm picking a random API that has inheritance. It is DOM
Range
.So, here we have two constructible classes
Range()
andStaticRange()
and we have a class calledAbstractRange
which both inherit from.MDN documents
AbstractRange
here:MDN documents
Range
here:Range
-specific members)MDN documents
StaticRange
here:Now, MDN documents
Range.collapsed
andStaticRange.collapsed
along withAbstractRange.collapse
:(and this is true for all AbstractRange members, you find them all also under
Range
andStaticRange
).Observations:
Range
variant manages to provide a code example.StaticRange
could have a code example and forAbstractRange
you would probably need to refer toRange
andStaticRange
for practical code.AbstractRange
is weird and doesn't make sense to me as is.So, what is the convention here? I think there are options:
The text was updated successfully, but these errors were encountered: