-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparams.json
More file actions
1 lines (1 loc) · 2.08 KB
/
params.json
File metadata and controls
1 lines (1 loc) · 2.08 KB
1
{"name":"Divineinject.GitHub.io","tagline":"","body":"# Divine Inject\r\n\r\nDivineInject is a .net dependency injection framework, designed to be simple to use and easy to understand.\r\n\r\n## Why?\r\n\r\nBecause dependency injection is important - but done wrong it can do more harm than good.\r\nDivineInject is opinionated about the right way to use dependency injection:\r\n\r\n* Constructor injection or death\r\n\r\n No, setter injection is bad for your health, just say no\r\n\r\n* Dependencies are singletons\r\n\r\n Dependencies are external to your application - your DI framework doesn't need to know about users or sessions or threads.\r\n \r\n* Domain objects can be rich, too\r\n\r\n Your domain model doesn't have to be [anemic](https://en.wikipedia.org/wiki/Anemic_domain_model)\r\n \r\n### Constructor Injection\r\n\r\nSetter and method injection are much harder to get right - so DivineInject simply doesn't support them. If you can't implement your dependencies as \r\nconstructor arguments, then maybe you should refactor the dependency so you can.\r\n\r\n### Singleton Dependencies\r\n\r\nAll dependency injection frameworks get wrapped up in different scopes. These are almost always confusing and open to abuse - so DivineInject\r\nsimply doesn't support them. With DivineInject all dependencies must be singletons. If you need a user- or session- or thread-specific dependency,\r\nthen implement the dependency provider in your own code. It's not hard to write, but it's a lot easier to debug when the code is under your control.\r\n\r\n### Rich Domain Objects\r\n\r\nDivineInject borrows an idea from [Google Guice](https://github.com/google/guice) - with Guice it is called \"assisted injection\", in\r\nDivineInject we call it generated factory injection. The idea is the same - providing a simple way to create objects with constructors\r\nwhich accept runtime arguments as well as dependencies to inject. This allows you to create rich, stateful domain objects which also have\r\ndependencies.\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}