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

  • Mastering Puppet 5
  • Ryan Russell Yates Jason Southgate
  • 139字
  • 2021-07-16 17:46:07

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.
主站蜘蛛池模板: 炉霍县| 阿拉善左旗| 河曲县| 大同市| 维西| 五指山市| 抚宁县| 泌阳县| 三江| 新泰市| 玛沁县| 双峰县| 怀安县| 奉节县| 盐边县| 南京市| 长泰县| 新乡县| 英德市| 凤台县| 枝江市| 新竹县| 深水埗区| 芜湖县| 体育| 鹿泉市| 化州市| 鞍山市| 甘南县| 庆元县| 德昌县| 深州市| 湄潭县| 临高县| 开鲁县| 惠州市| 江山市| 汤阴县| 德州市| 沙河市| 泽普县|