The Case Against Drop-Down Identities
smarterware.org3 pointsby spoondan0 comments
let di := DependencyContainer.make()
let moduleSystem := ModuleSystem.with_container(di)
di.register_singleton[IModuleSystem](moduleSystem)
moduleSystem.find_and_register_modules()
Where do we go from here? The next logical step is into `find_and_register_modules` or into the documentation for the module system (just kidding: I was a "senior engineer," I didn't write docs). match maybe_user
Some(&user) => nav.add(UserProfileNavItem.for_user(user))
None => nav.add("Login", "/login")
nav.add("Browse", "/browse")
nav.add("Search", "/search")
nav.add("Help", "/help")
Do you have to make a change here whenever something gets added? Yes. You do. But the idea that your program needs infinite flexibility in all areas is simply wrong. And, in fact, everything ends up secretly coupled and inscrutable.