Search code examples
classumldiagramvisual-paradigm

Improving my uml class diagram for a media library


I'm making a class diagram for a media library, like iTunes or Windows Media Player. My library contains audio, video and images. I'm fairly new to this, so I'm not sure if I'm heading in the right direction. This is what I got so far:

enter image description here

I feel like there should be a few more classes. Does anyone have some tips/suggestions on how to improve/expand this class diagram?

EDIT! I've tried to make the playlists a bit more clearer. I've also added an interface:

enter image description here


Solution

  • It seems fine to me in the main lines:

    • The Media specialization seems correct
    • The Person specialization seems correct
    • The Directs and Composes relationships seem right

    Nothing seems wrong here. But the Playlist composition is however not very clear. I have no obvious alternative, but here is the point...

    How it is introduced, your playlist might be composed by images, videos, audio records. The question is the relationship between the compositions.

    If you wish a playlist composed by image OR videos OR audio records non-exclusively, the playlist should be composed by medias in general.

    If you wish a playlist composed by image OR videos OR audio records exclusively, things become quite subtle. In your representation this is not obvious at all. At least a note should be welcome in order to specify the exclusive composition relationship. A solution would be to specialize the playlists: the specialized version would be instantiated on the insertion of the first element. This is up to what you really want to show. In any case, an explanation note would be very useful.