Let's talk about putting everything inside packages

The more I read about building apps entirely in packages, the more it seems the correct way to go. There seems to be quite a few ppl talking about it

Obviously being able to declare dependencies explicitly, control load order, and not pollute the global namespace is all great, but I’d like to hear from you people who are developing in this pattern what your approaches are. There are a couple different ways I’ve seen

This is a topic that seems to be gaining momentum as the “correct” approach for large-scale or enterprise grade applications, but the amount of writings out there describing how to do it properly and what all the advantages are is still little to none. Every book and guide I’ve seen doesn’t teach in this manner, so let’s talk about it and maybe get a reference going for newcomers who aren’t so familiar with the package-everything method.

So what’s your approach, and why do you think it’s the right way to go? How do you manage separating app-specific code from reusable code? What problems have you encountered?

I keep strictly-app-specific code in the app scope and put all reusable code into packages.

The reason I do that is how much I hate having to api.addFiles everything and not be able to move files and code around without having to update the references, which I almost always forget.

1 Like