FROM : j o a r
DATE : Sat Apr 19 01:02:00 2008
On Apr 18, 2008, at 2:56 PM, K. Darcy Otto wrote:
> The only reason to subclass Deduction (with SDeduction) and then
> DeductionLine (with SDeductionLine) is to get an SDependency
> object. Is there an easier way? I suppose I could just copy the
> Dependency class files and then modify it for this particular
> project; but I was hoping for a different way. Thanks.
I think that what you would typically do is either to add:
"-[DeductionLine initWithDependency:]"
// Where Deduction line doesn't know, or care about, what particular
// type of object is being passed, as long as it is either a subclass
of
// Dependency, or it conforms to a specific protocol.
Or something like:
"-[DeductionLine initWithProperty:]"
// Where the caller doesn't know about different Dependency classes,
// and instead specify some type of configuration / context property,
to
// which the DeductionLine responds by instantiating an appropriate
// Dependency subclass.
j o a r
DATE : Sat Apr 19 01:02:00 2008
On Apr 18, 2008, at 2:56 PM, K. Darcy Otto wrote:
> The only reason to subclass Deduction (with SDeduction) and then
> DeductionLine (with SDeductionLine) is to get an SDependency
> object. Is there an easier way? I suppose I could just copy the
> Dependency class files and then modify it for this particular
> project; but I was hoping for a different way. Thanks.
I think that what you would typically do is either to add:
"-[DeductionLine initWithDependency:]"
// Where Deduction line doesn't know, or care about, what particular
// type of object is being passed, as long as it is either a subclass
of
// Dependency, or it conforms to a specific protocol.
Or something like:
"-[DeductionLine initWithProperty:]"
// Where the caller doesn't know about different Dependency classes,
// and instead specify some type of configuration / context property,
to
// which the DeductionLine responds by instantiating an appropriate
// Dependency subclass.
j o a r
| Related mails | Author | Date |
|---|---|---|
| K. Darcy Otto | Apr 18, 23:56 | |
| j o a r | Apr 19, 01:02 | |
| Andy Lee | Apr 19, 01:09 | |
| Jack Repenning | Apr 19, 01:17 | |
| Manfred Schwind | Apr 19, 15:13 | |
| Dave Howell | Apr 19, 19:18 |






Cocoa mail archive

