Dcoder
前往频道在 Telegram
Software developer
显示更多未指定国家未指定类别
476
订阅者
+124 小时
+307 天
+4230 天
帖子存档
476
Repost from Mo' tries
Aight aight, there is this lil thing I made that am proud of lowkey.
It's a react router style routing lib for kotlin. Written in pure kotlin so you can use it anywhere.
It uses the builder pattern, you basically add your routes and the final .build() function makes a readonly prefix tree.
The reason we have a prefix tree (or Trie) is because we want a data structure that can look at a route like
/home/apps/me and select from the routes under each one (home, apps and me) the correct one.
Generally, when you see tree data structures in the wild, they usually solve a multiplexing problem (choosing one option out of many).
It's pretty neat, I used TDD for it.