From what I understand, composition in OO basically means that I put another object as a field in my new object. Is that correct? If so, I don't really see the fundamental difference from doing the same thing with a struct/record: put another struct/record inside another struct. Especially if I can use encapsulation to hide the internal structure of the struct/record.
Comments
From what I understand, composition in OO basically means that I put another object as a field in my new object. Is that correct? If so, I don't really see the fundamental difference from doing the same thing with a struct/record: put another struct/record inside another struct. Especially if I can use encapsulation to hide the internal structure of the struct/record.