Question

1. Discuss the difference between inheritance and composition. What are the advantages and disadvantages of each?...

1. Discuss the difference between inheritance and composition. What are the advantages and disadvantages of each? Can you implement one with the other?

2.How is a class similar to a database table? How is it different? How do these similarities and differences justify the need for class models and for data models? Or do they?

3.Discuss the difference between association and composition. What are the advantages and disadvantages of each?

4.When would you apply inheritance? When would you not? Provide examples of

when inheritance is appropriate and when it is not, discussing each.

5.Compare and contrast the concepts of coupling and cohesion. How do they relate,if at all, to one another?

6.Describe the relationship between polymorphism and typing.

7.Via the Internet, research common database technologies including relational databases, object databases, object-relational databases, XML databases, network databases, and hierarchical databases. Provide at least one example of each. Compare and contrast each technology, listing the advantages, disadvantages, and an indication of when you would use each.

8.How do interfaces reduce coupling in OO systems? In what ways might they increase it? Why?

0 0
Add a comment Improve this question Transcribed image text
Answer #1
compostion inheritance
It have HAS A It have IS A
it is easily achieved at runtime ,code reusability,extension of class behaviour it features provide at compile time,code reusability,extension of class behaviour

: A group of objects have to be treated in the same way as a single instance of an    object .

examples : 1.Duster is acar

2.safari is acar

thes belongs to car faily com[ostion represents Has a relation ship type.

it shows te ability of an object such as duster has five gears safari has four gears etc..,

whenever we need to extend the ability ofa an existing clas then use compostion .

Example: we need to add one more/u8nless all the derived gear inm duster object then we have to createdone more gear object and compose it to thedusser object we should not make the canges in base class untill all dervied class needed for

Class A dervies Class B

Class A dervies Class C

Class A dervies Class D

if add functionality in class A then tis will be available to all classes sub classes if C and D dont requried this functionality then we create aseparate class for those functionalities and compose it to theclass B

: the previous class extended with new features

example: student is a student but all students are humans ,their will be relation with humans and students this is inhheritance ,extence of previous class. we can use all superclass functions.

i can answer only one question according to HomeworkLib rules thank you

Add a comment
Know the answer?
Add Answer to:
1. Discuss the difference between inheritance and composition. What are the advantages and disadvantages of each?...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT