- 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.
- App Inventor移動應(yīng)用開發(fā)標(biāo)準(zhǔn)教程
- 吾老之域:老年人微信生活與家庭微信反哺
- 電信行業(yè)節(jié)能減排技術(shù)、方法與案例
- 信息光學(xué)原理
- 移動互聯(lián)網(wǎng)技術(shù)架構(gòu)及其發(fā)展(修訂版)
- Android底層開發(fā)技術(shù)實戰(zhàn)詳解
- 手繪圖說數(shù)字電路圖
- 海洋通信網(wǎng)絡(luò)協(xié)議、算法和架構(gòu)
- 5G:2020后的移動通信
- 整機(jī)裝聯(lián)工藝與技術(shù)
- 走進(jìn)業(yè)余無線電
- 5G承載網(wǎng)絡(luò)運維(中級)
- 電子工程師自學(xué)寶典:器件儀器篇
- Protel DXP 2004入門與提高
- LED制造技術(shù)與應(yīng)用