What is the handle class?

Answer Posted / beena

A handle is a class that maintains a pointer to an object that is programmatically accessible through the public interface of the handle class.

Explanation:


In case of abstract classes, unless one manipulates the objects of these classes through pointers and references, the benefits of the virtual functions are lost. User code may become dependent on details of implementation classes because an abstract type cannot be allocated statistically or on the stack without its size being known. Using pointers or references implies that the burden of memory management falls on the user. Another limitation of abstract class object is of fixed size. Classes however are used to represent concepts that require varying amounts of storage to implement them.

A popular technique for dealing with these issues is to separate what is used as a single object in two parts: a handle providing the user interface and a representation holding all or most of the object's state. The connection between the handle and the representation is typically a pointer in the handle. Often, handles have a bit more data than the simple representation pointer, but not much more. Hence the layout of the handle is typically stable, even when the representation changes and also that handles are small enough to move around relatively freely so that the user needn’t use the pointers and the references.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the equivalent of Pascal's Real a) unsigned int b) float c) char

593


How do you invoke a base member function from a derived class in which you’ve overridden that function?

586


What is istream c++?

576


What is dynamic and static typing?

679


give me an example for testing a program showing the test path .show how the test is important and complex.

2430






Does c++ have string data type?

695


Describe Trees using C++ with an example.

610


Explain what is polymorphism in c++?

629


What is type of 'this' pointer? Explain when it is get created?

591


What is an overflow error?

624


What are the general quetions are in DEna bank manager IT/System interviews?

1537


Explain register storage specifier.

597


What is searching?

659


What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?

622


How does a copy constructor differs from an overloaded assignment operator?

560