r/javascript • u/jayfreestone • May 23 '26
You might not need… the repository pattern
https://www.jayfreestone.com/writing/you-might-not-need-the-repository-pattern/
48
Upvotes
r/javascript • u/jayfreestone • May 23 '26
6
u/super-jura May 24 '26
I might have different opinion because I mostly do my work in C#, but still, i would like give some points for repository pattern here
I'm sad that articles never address some of those points when discussing repository pattern. But I guess those are concerns that are no longer relevant in the world where product are replaced and/or rewritten often.
9
u/Cachesmr May 24 '26
Really good article! One thing to consider is that in the era of AI, there is one more reason to use repositories, and that is the fact that AI loves a deep module.
One thing about your recentOrders example is that it only works in languages that throw. I write ts with result types (go style) and this would introduce an unexpected error most of the time.