dimanche 24 février 2019

Clarifying composition relationships

I have read that for composition relationships, component objects must exist during the life cycle of the container, and the container deletion may destroy the component objects.

If there are three classes Home, Office and HomeOffice, can it be said that the relationship between HomeOffice and Home/Office is composition as without Home and office, HomeOffice cannot exist. I am unsure as I saw some conflicting answers on composition that the container deletion must destroy component objects.

Aucun commentaire:

Enregistrer un commentaire