-
Notifications
You must be signed in to change notification settings - Fork 61
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
#340 merging pi4j-board-info into pi4j-core #341
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should perform the code to detect the board only once, and then store it in a singleton, or a class field on the BoardInfo class. It's quite heavy work to keep doing it, and it can't change at runtime anyhow.
Shouldn't we keep the JSON stuff out of core Pi4j? Let the REST API code generate the JSON code, then we don't need this dependency. |
@eitch I was expecting this ;-) is removed now... |
It's called from DefaultContext.java, so it's part of a singleton, correct? |
Sure, but maybe someone else would call BoardInfo.current(), as it is a static helper method. |
yep, in that case, it's up to the user to decide if they want to do that multiple times, right? |
True, but from a library i expect it to avoid unnecessary computations. So multiple calls should cache this computation somehow. |
To be able to use the data from the model in a REST API, this requires an extra dependency. Is this a problem?