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 ios class in c++?

661


What is a wchar_t in c++?

694


Explain explicit container.

720


When must you use a pointer rather than a reference?

684


Can the creation of operator** is allowed to perform the to-the-power-of operations?

662






Differentiate between an external iterator and an internal iterator?

661


How do you differentiate between overloading the prefix and postfix increments?

676


How do I make turbo c++ full screen?

671


Why is "using namespace std;" considered bad practice?

746


How come you find out if a linked-list is a cycle or not?

658


What do you mean by function pointer?

707


What is a c++ vector?

691


What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?

774


. If employee B is the boss of A and C is the boss of B and D is the boss of C and E is the boss of D. Then write a program using the Database such that if an employee name is Asked to Display it also display his bosses with his name. For eg. If C is displayed it should also display D and E with C?

2879


What is the use of pointer in c++ with example?

642