
Need help with UML Class Diagram (OOP Project) - Are my aggregation/composition diamonds backwards?
Hi everyone,
I'm currently working on a simple OOP project for my university course and I have to create a UML class diagram. I'm using StarUML for this.
I'm a bit stuck on the aggregation and composition relationships (the diamond shapes). I marked the ones I'm unsure about with blue arrows in the attached image.
My logic was always that the diamond goes on the "Whole" side of the relationship (for example, a Room contains Devices, so the diamond is connected to the Room class). However, I ran my logic through an AI tool to double-check, and it confidently told me that the diamonds should actually be on the other side (on the "Part" classes).
Now I'm completely second-guessing my understanding. Can someone take a look at my diagram and tell me if my current diamond placement is correct? Is my core logic sound, or did I completely mess up the direction?
Any feedback or advice would be greatly appreciated!