-
Notifications
You must be signed in to change notification settings - Fork 0
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
V2 #3
base: master
Are you sure you want to change the base?
Conversation
Some additional ideas: On testingI wrote none unit test but some integrating tests and make the test coverage at 100%. I used to write more unit tests than interesting tests. I found this approach to add little value to the maintenance.
In a word, integrating tests are preferred. I can be confident enough with 100% coverage of integrating tests. |
Plug or PhoenixEventually, in most cases, your application will grow and you will use Phoenix. But for this fixed requirement here, it won't. So |
This is the second attempt at doing the code challenge. It has been half a year since my last try, and I'm really happy to find that I have along the way harvest some new ideas on developing Elixir applications.
In this PR, I represent the lean technologies I think to satisfy such a requirement:
Small business core models
lib/core/product.ex
represents the Product modellib/core/store.ex
represents the Store modelBoth models are tiny. Upon them, states are maintained by a process,
lib/hoover/store_state.ex
.The boundary comes the most outside, providing a web interface, supported by
Plug
, communicating with the state process.It's layered but tiny.
Baseline for code quality
This is a basic boilerplate structure according to my experiences so far.
I'm pretty sure it can be improved. Please share what you think~