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

Suggestion: Singleton Pattern #6

Open
vkichline opened this issue Nov 6, 2020 · 0 comments
Open

Suggestion: Singleton Pattern #6

vkichline opened this issue Nov 6, 2020 · 0 comments

Comments

@vkichline
Copy link

There are a number of Singleton classes in Core2ez, but they don't follow the Singleton Pattern, designed for the kind of safety a library to be used by non-experts can benefit from:
See: Singleton Pattern or another

While the terms "sloppy" and "naïve" are used to describe the simpler version in the first reference, these are simply synonyms for "single threaded" and are probably completely safe to use in Core2ez; I don't see multi-threading being given special consideration anywhere (in Arduino code in general.)

Using the Pattern is safer (has been industrially tested) and makes the intention of the code clearer.

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

1 participant