[Class modifiers] Language feature docs #4497
Labels
a.language
Relates to the Dart language tour
e2-days
Can complete in < 5 days of normal, not dedicated, work
from.team
Reported by Dash docs team member
meta.umbrella
Collects multiple related issues
p2-medium
Necessary but not urgent concern. Resolve when possible.
st.triage.ltw
Indicates Lead Tech Writer has triaged
Milestone
Summary
Class modifiers determine how a class can be implemented, extended, or mixed in relative to the library it's defined in. Invariants like this are up to the library author; they can make types easier to understand and use.
Evaluation
Class modifiers will be a stand-alone page under "Language > Classes & objects" in the side navThere may also be coverage, or at least references to the core coverage, somewhere in the "Libraries" content.
The table of combinations:impacts is NOT necessaryMixin docs need to be updated: classes can't be used as a mixin by default anymore, must explicitly use the modifiermixin class
Class modifiers content needs to come after existing mixin content, because all the modifiers apply to mixins and classes.See Mixin restrictions section of spec for changes to mixins around the allowance of constructor declaration (currently can't declare a constructor, restrictions loosened)Potentially, for each new class modifier/class modifiers combination, briefly mention the use cases under "Motivation" in the spec to give users an idea of when to use this.e.g. "Thefinal
modifier` ... disallowing implementation and extension of a type makes it entirely safe to add new members to"Another way to organize this information would be the inverse, i.e. by motivation: "The modifiers disallow implementing or extending, which is good for.... "Make sure to add the page link to related diagnostics e.g. + implicit_reopen linter#4101
See [Dart 3] Document general use of class modifier by Dart core libraries in Library Tour #4730
(maybe) add something to development or package content about how modifiers are for package maintainers / developers who want to limit the usage capabilities for others using their package"extend a class" page and "implicit interfaces" section need to point to class modifiers page ("class modifiers restrict how classes can be extended/implemented")(maybe) move "abstract classes" section to class modifiers page?need to find and fix links to it across the site, add redirectadd mention + link to class modifiers in intro paragraph of main "Classes" pageNot sure if anything needs to change in "nosuchmethod" section based on this note:Change link for interface on 'Keywords' page #4662Resources
The text was updated successfully, but these errors were encountered: