Normally this is done, as has been said, via public accessors or public 'getters'.