adspace


What is the difference between containment and delegation?

Answer Posted / Awadhesh Prasad Gaur

Containment is a relationship in which one object has a pointer or reference to another object, allowing the containing object to access and manipulate the contained object. Delegation, on the other hand, is a design pattern in which an object defers some of its responsibilities to another object, usually by forwarding method calls to that object. In containment, the contained object is part of the containing object's lifetime; in delegation, the delegate object is independent.

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 latest version on c++?

1207


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

1165


daily Routine of father

1485


What character terminates all character array strings a) b) . c) END

1395


Can union be self referenced?

1267