Ports and Adapters - Struggling back to Beginner's Mind
I have to admit it: I've been struggling over the last two days.
I often create a Walking Skeleton at the start of an application. Lazydoro is now in its fifth version, there's already a finished working version, and it's difficult to 'un-know' how it evolved. Trying to create what I might have written at the start has been quite a challenge
The process has been valuable, though. I think I understand Ports and Adapters better through working on my sample code and explanation, and it's had another benefit.
I've set up an automated deployment process which I'll be able to use for future MicroPython projects.
Some applications can be deployed as a single file, but small modules are easier to read and test. lazydoro now consists of 9 files in a three-directory tree, and deploying a new version manually has become a real pain and is prone to error.
The new process uses a gist on GitHub which deletes all the files from a MicroPython-based board. It's always possible that your code relies on a file that you deployed a while back but have now forgotten about - a common cause of 'It works on My Machine'.
Deployment to an empty file system is the safest way of avoiding that.
There's more to the deportment task than that, and I'm documenting the whole malarkey.
I'm not sure how soon I'll have all the sample code ready, but you'll get to see three things:
- The automated deployment process
- The Walking Skeleton, and what you risk without one
- Ports and Adapters in an Embedded Application, and how that architecture helps with unexpected change.