Skip to content

Resolving primitives dependencies #237

Closed Answered by meadsteve
g0di asked this question in Q&A
Discussion options

You must be logged in to vote

@g0di this is a great question. It's really something that I should add to the documentation as it's a fairly important topic.

I'll first address the approach that lagom deliberately doesn't take (and won't in the future). Which is the one you mention like this:

container["foo"] = "some value"

one of design principles of lagom is Everything should be done by type. No reliance on names/magic strings. (from https://lagom-di.readthedocs.io/en/latest/CONTRIBUTING/#design-goals).

Next to answer your question for my apps using lagom I actually use some combination of the three approaches you mention. So I would say all three approaches are "recommended". Which one I use depends on the exact use…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by meadsteve
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants