Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterator Design Pattern concerns #2304

Closed
jojusuar opened this issue Dec 16, 2023 · 0 comments
Closed

Iterator Design Pattern concerns #2304

jojusuar opened this issue Dec 16, 2023 · 0 comments

Comments

@jojusuar
Copy link

jojusuar commented Dec 16, 2023

THIS ISSUE IS POSTED AS A COLLEGE ASSIGNMENT ON SOFTWARE DESIGN PATTERNS, PLEASE CLOSE THE
ISSUE IF YOU FIND IT TO BE USELESS.

Line referenced above declares an anonymous class to instantiate an Iterator object. However, this could be redesigned taking into account the Iterator Pattern, as follows:
iterator solution

In consequence, the FileSegment class (and other possible classes in the Collection package) will be relieved from the responsibility of declaring the logic of the iterators they use, in addition to enabling shared use of iterators among several classes.

@lintool lintool closed this as completed Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants