On Feb 1, 2011, at 2:02 PM, Dan Bode wrote:
> Hi all,
>
> I wanted to open the feature request
> http://projects.puppetlabs.com/issues/5824 for discussion.
>
> I like to specify all dependencies not defined within the enclosed scope
> using the new relationship syntax.
>
> This leads to nice clean error messages if the required resources have not
> been declared.
>
> class foo (
> $bar => 'baz'
> ) {
> Class['foo']->Class['super-ninja-app']
> .. resources and what-not
> }
>
> I often use this syntax to specify external dependencies of the class itself.
> I am starting to use this pattern *a lot*
>
> Having to specify
>
> Class['foo']-> within class foo { }
>
> in less than optimal for two reasons:
> 1. more characters
> 2. if the name of the class changes, then the reference to the class also
> needs to change
>
> I would like to introduce the 'self' keyword to be used in this situation.
I think a far better solution is to support static declaration of class
dependencies:
class foo requires otherclass {...}
or
class foo requires Yay[boo] {...}
Although I expect it would be an antipattern for classes to require things
other than classes and thus maybe shouldn't be supported.
This would get you what you want, plus make it really easy to build a graph of
classes and their relationships. Mmmm, graphs.
If that were added, would you still want the 'self' keyword?
--
Should I say "I believe in physics", or "I know that physics is true"?
-- Ludwig Wittgenstein, On Certainty, 602.
---------------------------------------------------------------------
Luke Kanies -|- http://puppetlabs.com -|- +1(615)594-8199
--
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.