The Application
object would always be in memory. It's only its reference that you are either caching as a field member or retrieving it every time for a local variable. The latter doesn't give you any space or time benefits.
The
Application
object along with all of its children and grandchildren objects would live on heap
only. All that the method getApplication()
is doing is to return the address
to the root
of this object tree. The address/pointer/reference size would remain the same irrespective of how long the object tree or big each object element is.