Java application monitoring given (as parameter) directory and printing (to sys out) various statistics.
Build with maven, to build it with test run
mvn package
There are 3 main bounded contexts/application layers:
- com.hicx.filestats.io - for retrieving file contents from directory
- com.hicx.filestats.files - readers (parsers) of supported file types
- com.hicx.filestats.statistics - supported statistics processors
As possibly in the future there will be need to support other than local filesystem file storages (eg.: amazon's s3) io package is an abstraction layer allowing future extension.
TODO
TODO
All independent pieces are glued together in 'com.hicx.filestats' package - entry point is App class.
I tried to keep dependency loosely coupled as possible - between modules there's only one - files -> io. Each package has it's well defined public interfaces with implementation hidden on default or private scope.
I was thinking on using spring to not have care about dependency management but in the end boiler plate code doesn't seem that big and I didn't add it
I used TDD for statistics and files module. Integration tests take a while - monitoring of new file take some time - area to improve.
I didn't have time to properly manage:
- file reader should have some limitation of chunk size (per new line can be too much)
- encoding - for simplicity I'm using system default
- proper unit tests for io and main package
- fat jar maven configuration (is it needed?)
- I think I have a bug as I'm moving also not supported/processed files - should that be the case?