On Jan 6, 4:04 pm, Daniel Pittman <[email protected]> wrote: > On Thu, Jan 6, 2011 at 12:29, Luc Suryo <[email protected]> wrote: > > Is it possible to define a class say php-fpm that requires the class > > php to be called first? if so what s the syntax? > > Yes: package { "foo": require => Class["bar"] } > > I think Nigel just pointed out in another thread that this is, in > fact, our recommended way to do cross-module and cross-class > dependencies. I certainly do, because it means you can change the > implementation of the PHP stuff without peturbing the php-fpm module > at all.
I'm not following that logic. How do whole-class dependencies isolate one class from changes to the other better than precise resource/ resource dependencies do? Whole-class dependencies produce a whole lot more edges in the resource-level dependency graph (n or n*m) than do single-resource dependencies (1). How does that not constitute much tighter coupling with per-class dependencies? No matter how many per-resource dependencies are declared, a Class/ Class dependency still produces a dependency graph that is a superset of that produced by all the per-resource dependencies between those classes' resources. It furthermore obscures the details of the dependencies so that some types of maintenance -- refactoring, for example -- are considerably more difficult. I'm not saying that per-class dependencies are always inferior, but one would be wise to consider carefully both their advantages and disadvantages in any given case. Inasmuch as they are shorthand for a collection of per-resource dependencies, per-class depenencies are never *necessary*. 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.
