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

Refactor HisparcMessageFactory and add tests #14

Open
davidfokkema opened this issue Apr 18, 2015 · 0 comments
Open

Refactor HisparcMessageFactory and add tests #14

davidfokkema opened this issue Apr 18, 2015 · 0 comments

Comments

@davidfokkema
Copy link
Member

Lots of duplication and complex logic. I think we should create a generic MessageFactory which accepts a class and a message, and uses simpler logic. Then, create two factory functions: HisparcMessageFactory and GpsMessageFactory. They simply call the generic factory with their respective classes.

As for the complex logic: we can drop a while loop if we let strip_until_start_codon raise an exception if there is no start codon left in the buffer. And we can probably drop the recursive call, although that may be not be a problem. Anyway: simpler logic, and test the thing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant