L -- > I thought this design point would be interesting, assuming I can make it > sufficiently clearly. > > I just did a refactor of my Interfaces work - previously, I had a base class > of Puppet::Interface, and all interfaces were subclasses of that class. > > However, once Dan Bode asked for a separation between interfaces that used > the Indirector and those that didn't, I suddently had the base class, a new > Puppet::Interface::Indirector class, and then subclasses of each. Then the > code smell showed up.
If I'm understanding you correctly, would it be safe to say that the problem really arose from having interfaces be subclasses of a base class, rather than instances of it? In other words, if we had SevenClass as a subclass on Integer (along with OneClass and NinteenClass, and so on) that would be the same smell, even if we never inserted anything (say, Cardinal) between them? I think the only place this sort of sub-class-singleton pattern is used with any frequency in the outside world is things like TrueClass / FalseClass which some in the Smalltalk world (which is where we got the pattern) have subsequently repudiated. It's very tempting when the proper is-a items are 1) a small fixed/limited set, 2) share little or no behavior. -- M ----------------------------------------------------------- When in trouble or in doubt, run in circles, scream and shout. -- 1920's parody of the maritime general prudential rule ------------------------------------------------------------ -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
