Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'best practices' page to documentation #32

Open
dotnetjunkie opened this issue Apr 22, 2016 · 1 comment
Open

Add 'best practices' page to documentation #32

dotnetjunkie opened this issue Apr 22, 2016 · 1 comment

Comments

@dotnetjunkie
Copy link
Collaborator

Many of the best practices are scattered throughout the documentation and articles across the internet. These best practices should be summarized in one wiki page, while linking to the complete articles when needed.

@dotnetjunkie
Copy link
Collaborator Author

dotnetjunkie commented Sep 28, 2016

Here's a starting point for some best practices:

  • DO Configure your container in one place: The Compostion Root
  • DO NOT let application code depend on the container
  • PREFER constructor injection over any other form
  • DO let components have only one public constructor
  • DO NOT use optional constructor arguments
  • DO NOT use Ambient Contexts
  • DO NOT work with runtime data using object construction
    • DO NOT inject runtime data into constructors of application components
    • DO NOT inject components based on runtime data.
  • AVOID the use of factories to create application components.
  • AVOID cyclic dependencies
  • AVOID constructor over-injection
  • DO let injection constructors be simple and fast
  • DO make attributes passive; behaviorless
  • What objects should be registered in the container and what not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant