kitchoi / packaway

Packaway is a tool for enforcing encapsulation and access control in Python by performing static code analysis.
MIT License
2 stars 0 forks source link

Modular Monoliths, Encapsulation and production use #7

Open antunesleo opened 3 years ago

antunesleo commented 3 years ago

I'm an enthusiast of modular monoliths and I'm currently studying tools to help it's implementation in python. Keep the modules isolated for each other in python is a challenge since there's nothing preventing anyone from doing importing private/internal stuff and as the code base is maintained by different teams with engineers from different levels, encapsulation violations is inevitable . IMO, a tool to enforce module encapsulation is necessary to not transform a modular monolith in a big ball of mud. Nicely I've found this promising repo. :raised_hands:

Are you guys using this in production projects? Are you implementing ideas from modular monoliths in these projects?

kitchoi commented 3 years ago

Hi @antunesleo, thank you for your message. Totally agreed with you there. To answer your questions,

Are you guys using this in production projects?

Unfortunately, no

Are you implementing ideas from modular monoliths in these projects?

Yes to some extent, but mostly no.

Why not? It can be difficult to convince developers who have seen big balls of mud that there are alternative solutions. It is sadly common/tempting to use version control repositories as a tool to enforce architecture boundaries. While multirepo may be effective in stopping people importing things they should not import, it brings in a whole loads of other very significant cost: This article has summarised the costs rather nicely. Setting up multirepos is easy, maintaining them is hard. Once that is set up, it can be quite difficult to work with and revert.

This repo has been part of an advocacy: To show it is possible to enforce discipline at lower cost. For new projects, my recommendation would be to start with a monorepo with encapsulation enforced at least at the module level, instead of breaking things up prematurely.

If you are interested in using packaway in production, I'd be more than happy to hear feedback and provide support where I can.

antunesleo commented 3 years ago

Yeah, I totally understand it, I've faced the same situation in previous projects . I'm working in a side project right now, small team that really want to implement modular monoliths. Despite that, as the codebase grows we can see an increase in the number of modules violations, some of them by accident. I will bring this package for the team, I think it will be a nice fit for us and if the team agrees, I think we will be the first client of the library.

Thank you for the support Kit

kitchoi commented 3 years ago

No problem! 👌