On Feb 14, 10:41 am, Nan Liu <[email protected]> wrote:
> On Tue, Feb 14, 2012 at 6:49 AM, ruslan usifov <[email protected]> 
> wrote:
> > Hello
>
> > In is possible inherits from parametrized class??


Is class inheritance really would you should be using?  If your
intention is for the child class to override properties of resources
declared by the parent class, then yes; otherwise no.  From your
example it appears no resource overriding is intended, so probably
"no".

It looks like what you're really looking for is class composition, and
that's exactly the solution that Nan proposed to you.  Do not use
inheritance to achieve composition.


> It's not currently possible, and I don't know if it's 100% clear when
> you inherit and add parameters do you intend inherit the parent's
> default, override the parent's default, or to pass new parameters.


And this is one of the lesser reasons to avoid parameterizing your
classes.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" 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-users?hl=en.

Reply via email to