I have following task: Implement a mechanism that can take any collection of objects
(Array, List, etc.) and then allows you to read elements regardless of the container in
where they are stored. Please, tell me which design pattern should I use for this task?
I have following task: Implement a mechanism that can take any collection of objects
Share
Your solution probably will use the Iterator pattern, and could also use the Adapter (or wrapper) pattern.
I’m assuming that this is “homework”, so I’m not going to provide you example code.