Paper Details  
 
   

Has Bibliography
22 Pages
5416 Words

 
   
   
    Filter Topics  
 
     
   
 

Exam tests

te how functions defined in each class in a group of partially abstract classes can specify a standard pattern of interaction among instances of these classes. (2 marks) Explain the role of the "Wizard" (or "Expert" or "Architect") component as typically incorporated in a development environment for the creation of applications based on a framework class library. (1 mark) Explain the "counted pointer idiom" (low level C++ design pattern). (2 marks) •The overall context is the management of heap memory for dynamically allocated structures •Remember that unlike Java, C++ doesn’t have automated garbage collection; it is the programmer’s responsibility to delete dynamic structures when they are no longer required.•Once an object has been created in the heap via the new operator, its address can be passed around as a pointer value.•Copying of pointer values can lead to many different pointers referencing the same dynamic structure.Such structures result in “sharing” of the referenced object by the objects (or currently executing functions) that have pointers referencing the object.•In most cases, this “sharing” is an artefact.•In a few cases (such as those considered by Meyers) you may actually desire “sharing”. •The solution uses objects from two classes–The original instance of the class that got allocated in the heap and which ended up getting “shared”–An intermediary object•Keeps track of the references to the “shared” object–Organizes deletion of shared object when the last pointer referencing it is removed–Prevents deletion until the last reference is removed•Forwards all requests for actions to the shared object•When one of these pointers is destroyed (the object of which it is a part is deleted, or the function in which it is a local variable is exited) the issue arisesShoul...

< Prev Page 15 of 22 Next >

    More on Exam tests...

    Loading...
 
Copyright © 1999 - 2025 CollegeTermPapers.com. All Rights Reserved. DMCA