Forum: CFEngine Help
Subject: Re: Having trouble setting a custom class. "Irreconcilable 
constraints" error but there are no constraints.
Author: sauer
Link to topic: https://cfengine.com/forum/read.php?3,23477,23490#msg-23490

It's my understanding that the goal is not so much to create the most compact 
code, but to encourage abstraction of code as a means of improving readability. 
 Your class definition is creating a layer of abstraction, and it's perfectly 
reasonable to require someone to actually define what's being abstracted, thus 
allowing the detais of the abstraction to be visible should someone seek it 
out.  That ability to read a high-level description, and then optionally drill 
down to more detail sticks in my mind as an explicitly stated design goal 
somewhere...

Besides, the only really good reason to define a new class in your policy based 
on "any" is that you plan to some day have a different, more specific criteria 
which defines this class.  Adding the "expression => any" into the code acts as 
a placeholder reminding you to one day finish writing that code. If you really 
will never change the definition from "any", then why not just use "any" to 
begin with and skip creating a new class? :)

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

Reply via email to