What is the handle class?



What is the handle class?..

Answer / 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

More C++ General Interview Questions

Can I uninstall microsoft c++ redistributable?

0 Answers  


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

0 Answers  


List the types of polymorphism in c++?

0 Answers  


What do the header files usually contains?

0 Answers  


Where the memory to the static variables is allocated?

0 Answers  






what is data abstraction in C++?

0 Answers  


i want to know how to copy arrary without using any method or function. I have tried the below using System; class e4 { static void Main(string[] args) { int a,b; int[ ] m= new int[5]; int[ ] n= new int[5]; for(a=0;a<=4;a++) { Console.WriteLine("enter any value"); m[a]=Convert.ToInt32(Console.ReadLine()); m[a]=n[a]; } for(b=0;b<=4;b++) { Console.WriteLine(n[b]); } } } but it will give wrong result can anyone solve this problem

1 Answers   Reliance,


Write a String class which has: 1) default constructor 2) copy constructor 3) destructor 4) equality operator similar to strcmp 5) constructor which takes a character array parameter 6) stream << operator

2 Answers   HCL, Lehman Brothers, Zoomerang,


What is c++ virtual inheritance?

0 Answers  


write a program that a 5 digit number and calculates 2 power that number and prints it.

2 Answers   Vimukti Technologies,


How would you call C functions from C++ and vice versa?

0 Answers   Genpact,


When a function is made inline. Write the situation where inline functions may not work.

2 Answers  


Categories