If we consider a UML diagram where we have an object which contains a collection of objects of another class.
What kind of relationship will be there,between both the classes.
Will it be aggregation or it will be Composition ?
The object having collection wont directly be having these objects, instead the collection will be holding them.
but then in this case can we represent it as 1 is to Many, containment kind of relationship ?
I am very new to UML, I am sorry if It seems a total noob question.
Less U.M.L., More Conceptual, Practical Answer
You have a first object, that contains another second object.
The second object its by itself a collection, that contains several object elements.
In a very technical, design or programming point of view, someone could think of the elements, not be related to the first object, but, to the second object as its container.
The first object its delegating the process of containning & managing objects to the second object.
I have use this case, several times, in Design & Programming. In many collection libraries, (arrays, lists, stacks), each item has a reference to the container.
I sometimes, add the reference to the first object itself, in each item.
So, you may think, of the main first object, & the collection object, as a single object.
Cheers.