In this section, we will take a deep dive and learn how to enforce more granular control over the fields of an object by using the property interface. Julia's property interface allows you to provide a custom implementation for the dot notation used in field access. By overriding the standard behavior, we can apply any kind of access control and validation against the field being referenced or assigned. To illustrate this concept, we will tackle a new use case here – implementing a lazy file loader.
Property patterns
Introducing the lazy file loader
Suppose that we are developing a file loading facility that supports lazy loading. By lazy, we are talking about not loading a file until the content is required...