On Mar 6, 7:53 am, "chris_sny...@sra.com" <chris_sny...@sra.com>
wrote:
> I don't understand Puppet Language.  How can you take object-oriented
> constructs such as 'class' and 'inheritance' and then not allow things like
> multiple instances of a class, albeit with differing parameters.


That would be a travesty, but it's not what Puppet has done.  Instead,
Puppet has taken entirely different constructs and named them in a
manner that confuses you.  You know, just to keep you on your toes.


> Defined
> resource types don't help me as they don't have inheritance (which is
> something I very much want).


No, you don't.  Or at least, the object-oriented kind of inheritance
that you think you want is not available from Puppet, so the fact that
neither defined types nor classes offer it does not distinguish
between the two.

Puppet's class inheritance is designed expressly for allowing the
properties of resources declared in a superclass to be overridden by a
subclass.  Even that probably excites the OO programmer in you more
than it should.  In practice, overriding resource properties is never
more than a convenience.  Puppet offers several alternatives, some of
them cleaner.

Supposing that you're a good OO programmer, you will be aware of the
classic question of inheritance vs. composition.  In my experience,
the better choice in OO programming is more often "composition" than
many practitioners recognize, but in Puppet DSL, "composition" is
*almost always* the better choice.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to