Forum: CFEngine Help
Subject: Re: Detriment to being explicit about "any::" ?
Author: jgreer
Link to topic: https://cfengine.com/forum/read.php?3,23421,23422#msg-23422

There's no technical reason not to do so, and I think this is a decent style 
rule, if for nothing more than developing good habits and readable code.

Not sure whether unintended policy bleed was your main concern here, or just 
stylistic consistency, but risk of unintentional exposure was a concern of 
ours.  

This is basically our approach:

- very commonly-shared policy (primarily stuff we apply to any, or to 
OS-specific hard classes - very few soft classes here) goes in a "main" bundle.
- main also contains a methods: section with "usebundle" promises protected by 
soft classes (for the Drupal class, use the Drupal bundle; for Nagios, use the 
Nagios bundle, etc.)
- all promises in app/project specific bundles are further protected by their 
related soft classes, to protect against the scenario in which a "usebundle" 
promise in main accidentally gets applied to the wrong class by virtue of 
deleting/transposing class protections

I'm a huge fan of using 'methods' promises for this kind of safety - on top of 
that, this allows your bundlesequence to be very short and sweet.
 
Hope this helps.

-Jessica

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to