mauroalderete / gcode-core

Golang library to model and edit G-code commands, blocks from files
MIT License
7 stars 1 forks source link

apply conventions and better practice to organise the project #31

Closed mauroalderete closed 2 years ago

mauroalderete commented 2 years ago

resolve #27

I reorganize the project struct. I move files and code blocks on new packages. The main packages Gcode and Block only export interfaces. The sub-packages contain basic implementations that allow the users can exploit them speedily. At the same time, the interfaces exposed allow the implementation of new gcode and block instances if it is necessary.

The gcode and block packages are prepared to support DI. These expose factory interfaces to that each user can code own his implementation of the factory.

The gcodeblock, unaddresablegcode and addressablegcode sub-packages export a series of constructors functions. These can be used easily, however, decrementing the decoupling.

I implement an improved version of the self-reference function options design pattern, that achieves the isolation and safety of the new instance. This was written in the block and gcodeblock package, where we need two ways to instance a new block, each with requirements different.

In general, I reformulate many unit tests and rewrite documentation.

mauroalderete commented 2 years ago

resolve #25