answersLogoWhite

0


Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: What is object composition and delegation?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is delegation in oops concept?

Delegation allows the behavior of an object to be defined in terms of the behavior of another object.ie, Delegation is alternative to class inheritance. Delegation is a way of making object composition as powerful as inheritance. In delegation, two objects are involved in handling a request: a receiving object delegates operations to its delegate. this is analogous to the child classes sending requests to the parent classes.Example in a Java/C# like language class A {void foo() {this.bar() // "this" is also known under the names "current", "me" and "self" in other languages}void bar() {print("a.bar")}}class B {private A a; // delegationlinkpublic B(A a){this.a = a;}void foo() {a.foo() // call foo() on the a-instance}void bar() {print("b.bar")}}a = new A()b = new B(a) // establish delegation between two objectsCalling b.foo()will result in a.bar being printed, since class B "delegates" the method foo() to a given object of class A.


What is the difference between inheritance and delegation?

When you inherit you typically override and specialise the virtual methods of the base class. With delegation, you embed a member object in your class and provide an interface (often a simplified interface) to that embedded object. Each embedded object takes care of itself, the container merely provides an interface and delegates the calls to the object itself.


What is the type of matter that makes up an object and its arrangement in the object?

composition


Why did composition become a new challenge for renaissance artists?

[object Object]


What is a homogeneous object?

A homogeneous object, is an object with the same composition throughout it's entire volume.


What is it called when there is no uniform in a composition?

A substance or object that is not uniform in composition would be a heterogeneous mixture.


Composition of autobiography of an inanimate object?

hhh


What are the effects of hot water on an object?

Expansion. Depends on the object's composition though.


How can heat affect the state of an object?

Heat can affect the molecular composition of an object.


How do the different forms of potential energy depend on an object's position or decimal compulsion composition?

Potential energy does not depend on an object's decimal compulsion composition.


What object is the type of matter that makes up the object and the way that the matter is arranged?

composition


composition?

The type of matter and it's arrangements in an object.