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

Explore making ReadElement independent of parsedData #11

Closed
suyashkumar opened this issue Jul 6, 2018 · 2 comments · Fixed by #13
Closed

Explore making ReadElement independent of parsedData #11

suyashkumar opened this issue Jul 6, 2018 · 2 comments · Fixed by #13
Assignees
Labels
enhancement New feature or request

Comments

@suyashkumar
Copy link
Contributor

suyashkumar commented Jul 6, 2018

As mentioned in #7, making ReadElement API independent of previously parsed data would be a good choice.

@suyashkumar
Copy link
Contributor Author

suyashkumar commented Jul 6, 2018

One way to do this (at least from an API perspective) would be to create a Parser that has ReadElement as an attached method. A struct implementing Parser would hold a reference to all parsed elements that effectivly is injected into every ReadElement call anyway. The Parser implementing struct could also hold onto other initialized items like a channel for passing parsed frames over as intended in #5.

@suyashkumar
Copy link
Contributor Author

this makes things more testable too (woo)

suyashkumar added a commit that referenced this issue Jul 9, 2018
This change refactors the core `go-dicom` API to use an interface called `Parser`. This allows for more elegant dependency injection of items (like channels, previous data elements) with a clean end user api (so that the user doesn't have to worry about passing in those references themselves). Using an interface like this will also make typical testing easier on the end user, and is also more canonical golang imho. This closes #11 and addresses #3. This also puts some plumbing in place for #5.
@suyashkumar suyashkumar self-assigned this Jul 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant