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

What new()is different from malloc()?

0 Answers  


Explain binary search.

0 Answers  


Why the usage of pointers in C++ is not recommended ?

0 Answers   TCS,


When is the last time you coded in C/C++? What is the most lines of original C/C++ code you have personally written in one project? How confident are you in your ability to write C or C++ without a reference?

1 Answers   Microsoft,


How does code-bloating occur in c++?

0 Answers  






What are the different types of comments allowed in c++?

0 Answers  


Q1 On the screen how do you write the following words? she sells seashells by the seashore (a) all in one line (b) in three lines Q2 Write a program that asks interactively the user’s name and age and responds with Hello name, next year you will be next_age. where next_age is age + 1 Q3 For the different values of n, what is the output? printf(“%x %c %o %d”,n,n,n,n); (a) n = 67 (b) n = 20 (c) n = 128 (d) n = 255 (e) n = 100 Q4 What will be the output of the following program? int main() { char a,b,c; scanf(“%c %c %c”,&a,&b,&c); printf(“a=%c b=%c c=%c”,a,b,c); return 0; } [Note: The user input is:ABC DEF GHI]

1 Answers  


What is null c++?

0 Answers  


Difference between delete and delete[]?

5 Answers   Infosys, TCS, Virtusa,


What is lazy initialization in c++?

0 Answers  


What is operator overloading in c++ example?

0 Answers  


By using c++ with an example describe linked list?

0 Answers  


Categories