官术网_书友最值得收藏!

Using the encapsulation principle

As far as possible, these classes should use encapsulation to hide the implementation details from the user; for example, users of your module don't need to be aware of individual resource names. In software engineering, we call this encapsulation. For example, in a config class, we can use several resources, but the user doesn't need to know all about them. Rather, they just simply know that they should use the config class for the configuration of the software to work correctly.

Having classes contain other classes can be very useful, especially in larger modules where you want to improve code readability. You can move chunks of functionality into separate files, and then use the contain keyword to refer to these separated chunks of functionality.

See https://puppet.com/docs/puppet/5.3/lang_containment.html website for a reminder about the contain keyword.
主站蜘蛛池模板: 镇巴县| 上犹县| 鄂伦春自治旗| 商都县| 聂拉木县| 和静县| 胶南市| 康马县| 仙桃市| 林西县| 陇南市| 邵武市| 楚雄市| 文成县| 汕尾市| 黄冈市| 和平区| 含山县| 旬邑县| 天门市| 乃东县| 东海县| 利川市| 和平县| 师宗县| 晋州市| 九台市| 临高县| 镇雄县| 库车县| 屏边| 彭水| 台南县| 前郭尔| 徐州市| 宜城市| 赣榆县| 东乌| 琼中| 金川县| 浦北县|