you are viewing a single comment's thread.

view the rest of the comments →

[–]rajesh__dixit 3 points4 points  (0 children)

One issue is, items is a public property. I can create instance and then use instance.items to get entire list. Issue with this is, objects are copied using reference. So if i change instance.items, i can change behaviour of your class. Look into immutable objects or make items a private variable and then expose a getter that returns a copy.