Q8. Recording companies consider band and musician to be type of artist. A band consists of two or more musicians. Each song has an artist who wrote it. An artist can write a number of songs but each song is written by exactly one artist. A CD is composed of a number of tracks, each of which contains exactly one song. However, a song can be used in any number of tracks, because it could appear on more than one CD. Name the classes and draw a UML class diagram showing classes and relationships between classes with appropriate multiplicities. CD Track Song Artist Band Musician 1 * * 1 * 1 1 2..
5 Q9. Explain the decoupling achieved through use of the Observer design pattern. Q10. Describe the difference between white box and black box testing, for a given class. Which one is JUnit more suited for, and why? Q11. Why should composition be favoured over inheritance?
6 Q12. The HiHat Recording Studio is used by artists to record songs for release on CD. The studio is planning a new system to store all recorded songs electronically. Artists can add new songs and listen to songs. They can also add layers (of sound) to an existing song, and compile a CD out of previously recorded songs, both of which will involve listening to the songs. Sometimes artists hire session musicians to add layers to their songs, but session musicians cannot create new songs or compile CDs. A sound engineer can create a new mix for a song (by adjusting the various layers of sound). If a musician is unhappy with a mix, the sound engineer can remix it –which really just means creating a new mix to replace the old one. Draw a use case diagram for the proposed system.