• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

justify answer object reuse

 
venkat lakkakula
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
question: 1.which are following support object reuse?
1.class inheritance
2.object composition
3.java beans
4.attributes
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would go with JavaBeans. "Reusable components JavaBeans"


Thanks,
 
John Stone
Ranch Hand
Posts: 332
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1, inheritance - you are reusing something already written and adding/overiding new stuff
---
2, this is just using old stuff, so I see no reuse here
3, do not know, but looks like using only components already written
4, nonsense

- question says object reuse, so I'm not sure now. I was thinking more about class reuse.
 
Matt Russell
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not clear what is intended by the term "object reuse". I'm guessing it means reuse of implementation, so this is my take given that assumption:

Inheritance and composition are the two big mechanisms for reusing functionality in an object-oriented language. In addition, the idea of JavaBeans, as Chandra points out, is to create reusable software components. Without qualification, the fourth option, "attributes", doesn't make much sense.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic