Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Dependency Injection

Discussion in 'General Discussion' started by lobozinho, Jun 10, 2023.

Thread Status:
Not open for further replies.
  1. lobozinho

    lobozinho

    Joined:
    Mar 24, 2023
    Posts:
    1
    I'm researching about Dependency Injection. I am familiar with Unity Container, Autofac, Castle Windsor, and Zenject. I would like to ask everyone which one is the most popular and how to determine which one to use for my project. I would appreciate examples of how each one is used. Thank you for reading this post.
     
  2. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,900

    Please. Just a couple of threads down:
    https://forum.unity.com/threads/dependency-injection-in-unity-unity-uses-it.1423569/

    Do not open duplicate threads.
     
  3. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,082
  4. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,317
  5. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    PLEASE do not duplicate post. It is expressly against forum rules. Both of your posts have been reported.

    This is a Unity forum. Unity uses scenes for dependency injection.

    Why bother with anything else? You won't impress Unity.

    The first scene (scene zero in your list) specifies (in data format) precisely what classes to make.

    Those classes then run your program.

    Otherwise, things like zenject are a complete disaster in Unity. Run screaming.
     
Thread Status:
Not open for further replies.