But for larger applications, especially with everchanging collection schemas / models, where there are lots of collections with multiple references to other collections and strong referential data integrity requirements - I’m perfectly fine with mongodb, let’s not get into a sql/nosql argument; I feel like I am painting myself into a corner, especially when I don’t use explicit getters and instead directly access document properties such that when a property gets changed it becomes very hard to refactor that to meet the new model requirements.
Using the wonderful webstorm does not help much there either and having to resort to cumbersome find/replace/test/fix is not much fun.
And that (getters) is not the only thing I keep finding my self missing or subconstiously implementing.
I resort to taking cues from ideas (that I’m already trying to abandon) like getters/setters, data access objects, interfaces, centralize queries etc.
I even found myself reading a typescript tutorial at some point today! Wow! just like emotional eating
And this is just the data layer. Other layers of the app seem to require (although to a lesser extent) similar object-orientification.
The thing is, I only seem to want that for easy refactoring paths. Other than that, I’m perfectly fine with creating and composing functions. Heck, I’m even fine with procedures since I’m blessed with significant pascal and fortran experience LOL
So, what do you guys do to keep sane refactoring paths, especially with schema changes.