This is a class design issue with Objective-C. Here is an example:
File systems have files and directories. Both are "nodes." Going through a directory, for example, gives a list of nodes, some of which are [sub] directories, others are files.
This indicates the following abstract view of the class hierarchy on the client side:
@interface Node: NSObject {}
@end
@interface Directory: Node {}
@end
@interface File: Node {}
@end
So far so good. At this point, all three classes are abstract. Now you go to the implementation, you understand that there are two main ways: using URLs (Apple recommended for Mac OS X ≥ 10.6) or paths (only for Mac OS X ≤ 10.5 or Cocotron ).
So, now you need to develop two specific implementations of each of the three abstract classes above:
@class NodeWithPath;
@class NodeWithURL;
@class DirectoryWithPath;
@class DirectoryWithURL;
@class FileWithPath;
@class FileWithURL;
Now consider, say FileWithURL:
- ,
File. - node, URL-,
NodeWithURL
File NodeWithURL . Objective-C.
, ? :
. Directory File , Node . Node : URL-, .
. Node. , Node<File> Node<Directory>, .
/// ?