Who Allocates, Who Deletes, Who Uses, What's Shared

The ownership of objects is one of the most important concerns in object-oriented programming. In the case of theAccumulator, theExternalInterface, and theTape passed to aController, the instances are owned by the part of the program that defined the instance of aController (in this case, main()). aController is not empowered to get rid of these objects, because it only has references to them. However, the compiler does not enforce this policy, so you must.

Other classes, such as aRequest and anAccumulator, retain complete ownership over their member variable storage, which is created and destroyed along with the instance.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.182.96