Difference between revisions of "Category"

From GNUstepWiki
Jump to navigation Jump to search
 
(Added to category Objective-C)
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
 
The obvious advantage is that all classes that inherit from the original class would automagically also inherit the additions of your category.
 
The obvious advantage is that all classes that inherit from the original class would automagically also inherit the additions of your category.
  
One disadvantage is that a category cannot add [[instance_variable]]s.
+
One disadvantage is that a category cannot add [[instance_variable|instance variables]].
 +
 
 +
 
 +
[[Category:Objective-C]]

Latest revision as of 09:44, 21 June 2006

Categories let you extend the behaviour of a class without having to subclass it.

The obvious advantage is that all classes that inherit from the original class would automagically also inherit the additions of your category.

One disadvantage is that a category cannot add instance variables.