]> gitweb.factorcode.org Git - factor.git/commitdiff
Tuple subclassing help article: Fixed typo
authorotoburb <otoburb@gmail.com>
Thu, 24 Mar 2011 04:48:48 +0000 (04:48 +0000)
committerotoburb <otoburb@gmail.com>
Thu, 24 Mar 2011 04:48:48 +0000 (04:48 +0000)
core/classes/tuple/tuple-docs.factor

index 6de3ed29578a537a54024c8bc3bc7516b9e73a76..6587889de6b5157b99b5d5a27b426e4fa828a8af 100644 (file)
@@ -175,7 +175,7 @@ $nl
 $nl
 "There are two alternatives which are preferred to subclassing in this case. The first is " { $link "mixins" } "."
 $nl
-"The second is to use ad-hoc slot polymorphism. If two classes define a slot with the same name, then code which uses " { $link "accessors" } " can operate on instances of both objects, assuming the values stored in that slot implement a common protocol. This allows code to be shared without creating contrieved relationships between classes."
+"The second is to use ad-hoc slot polymorphism. If two classes define a slot with the same name, then code which uses " { $link "accessors" } " can operate on instances of both objects, assuming the values stored in that slot implement a common protocol. This allows code to be shared without creating contrived relationships between classes."
 { $heading "Anti-pattern #3: subclassing to override a method definition" }
 "While method overriding is a very powerful tool, improper use can cause tight coupling of code and lead to difficulty in testing and refactoring. Subclassing should not be used as a means of “monkey patching” methods to fix bugs and add features. Only subclass from classes which were designed to be inherited from, and when writing classes of your own which are intended to be subclassed, clearly document what subclasses may and may not do. This includes construction policy; document whether subclasses should use " { $link new } ", " { $link boa } ", or a custom parametrized constructor."
 { $see-also "parametrized-constructors" } ;