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

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.
主站蜘蛛池模板: 小金县| 宽甸| 江城| 板桥市| 焉耆| 辽阳县| 唐河县| 龙口市| 韶关市| 连州市| 建宁县| 锡林浩特市| 积石山| 九龙县| 德惠市| 泾川县| 丹巴县| 冕宁县| 九龙坡区| 贵港市| 石嘴山市| 黄龙县| 高阳县| 固原市| 红安县| 建平县| 清镇市| 莲花县| 福贡县| 绥芬河市| 邳州市| 霍林郭勒市| 天长市| 福安市| 平果县| 资中县| 隆子县| 乳源| 涟水县| 西林县| 乐昌市|