Working on a project.
An object contains an instance of a Commander Class Object. This has two child objects, Config and Logger.
The Logger constructor requires variable values from the Parent Class object and potentially the Config Class object. In the Logger Constructor, I would need to access Commander.Config.SQL_Instance to configure the Logger Object.
Is there an elegant way around this, or do i need to pass the parent object to the child constructors?
EDITED: Commander Commander.Config Commander.Config.Settings Commander.Config.Settings.SQL_Instance Commander.Logger Commander.Logger.Entry Commander.Function
When the Logger class is created as part of the Commander Object, the Logger cnstr is passed the required objects from Commander.Config.Settings.
Moving onto the Commander.Function Methods in this class, will need to call upon the Commander.Logger.Entry method to generate Log entries.