This chapter will cover several patterns that can be used to improve software robustness. By robustness, we are referring to the quality aspects, that is, can the software perform its functions correctly? Are all possible scenarios handled properly? This is an extremely important factor to consider when writing code for mission-critical systems.
Based on the Principle of Least Privilege (POLP), we would consider hiding unnecessary implementation details to the client of the interface. However, Julia's data structure is transparent – all fields are automatically exposed and accessible. This poses a potential problem because any improper usage or mutation can break the system. Additionally, by accessing the fields directly, the code becomes more tightly coupled with the underlying implementation of an object. So, what if a field name needs to...