{"id":16209866,"url":"https://github.com/jdsherbert/unreal-engine-dependency-injection-plugin","last_synced_at":"2025-03-19T08:31:08.939Z","repository":{"id":216210117,"uuid":"740728568","full_name":"JDSherbert/Unreal-Engine-Dependency-Injection-Plugin","owner":"JDSherbert","description":"Simple implementation of a Dependency Injector Plugin for Unreal Engine. Uses a Singleton instance to hold the registered objects.","archived":false,"fork":false,"pushed_at":"2024-06-09T23:35:34.000Z","size":47,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T05:11:53.456Z","etag":null,"topics":["cpp","dependency-injection","dependency-manager","plugin","plugins","singleton-pattern","unreal","unreal-engine","unreal-engine-4","unreal-engine-5"],"latest_commit_sha":null,"homepage":"https://github.com/JDSherbert/Unreal-Engine-Dependency-Injection-Plugin","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JDSherbert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-09T00:06:06.000Z","updated_at":"2025-01-07T19:27:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"46757840-8a7f-4fb1-9f1c-54d6a106e0d1","html_url":"https://github.com/JDSherbert/Unreal-Engine-Dependency-Injection-Plugin","commit_stats":null,"previous_names":["jdsherbert/unreal-engine-dependency-injection-module"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDSherbert%2FUnreal-Engine-Dependency-Injection-Plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDSherbert%2FUnreal-Engine-Dependency-Injection-Plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDSherbert%2FUnreal-Engine-Dependency-Injection-Plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDSherbert%2FUnreal-Engine-Dependency-Injection-Plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JDSherbert","download_url":"https://codeload.github.com/JDSherbert/Unreal-Engine-Dependency-Injection-Plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244389843,"owners_count":20445013,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","dependency-injection","dependency-manager","plugin","plugins","singleton-pattern","unreal","unreal-engine","unreal-engine-4","unreal-engine-5"],"created_at":"2024-10-10T10:33:37.731Z","updated_at":"2025-03-19T08:31:08.630Z","avatar_url":"https://github.com/JDSherbert.png","language":"C++","readme":"![image](https://github.com/JDSherbert/Unreal-Engine-Dependency-Injection-Module/assets/43964243/3f6a8f1e-a566-4148-951e-b4e383de069b)\n\n# Unreal Engine Dependency Injection Plugin\n\n\u003c!-- Header Start --\u003e\n\u003ca href = \"https://docs.unrealengine.com/5.3/en-US/\"\u003e \u003cimg height=\"40\" img width=\"40\" src=\"https://cdn.simpleicons.org/unrealengine/white\"\u003e \u003c/a\u003e \n\u003ca href = \"https://learn.microsoft.com/en-us/cpp/cpp-language\"\u003e \u003cimg height=\"40\" img width=\"40\" src=\"https://cdn.simpleicons.org/c++\"\u003e \u003c/a\u003e\n\u003cimg align=\"right\" alt=\"Stars Badge\" src=\"https://img.shields.io/github/stars/jdsherbert/Unreal-Engine-Dependency-Injection-Module?label=%E2%AD%90\"/\u003e\n\u003cimg align=\"right\" alt=\"Forks Badge\" src=\"https://img.shields.io/github/forks/jdsherbert/Unreal-Engine-Dependency-Injection-Module?label=%F0%9F%8D%B4\"/\u003e\n\u003cimg align=\"right\" alt=\"Watchers Badge\" src=\"https://img.shields.io/github/watchers/jdsherbert/Unreal-Engine-Dependency-Injection-Module?label=%F0%9F%91%81%EF%B8%8F\"/\u003e\n\u003cimg align=\"right\" alt=\"Issues Badge\" src=\"https://img.shields.io/github/issues/jdsherbert/Unreal-Engine-Dependency-Injection-Module?label=%E2%9A%A0%EF%B8%8F\"/\u003e\n\u003cimg align=\"right\" src=\"https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FJDSherbert%2FUnreal-Engine-Dependency-Injection-Module%2Fhit-counter%2FREADME\u0026count_bg=%2379C83D\u0026title_bg=%23555555\u0026labelColor=0E1128\u0026title=🔍\u0026style=for-the-badge\"\u003e\n\u003c!-- Header End --\u003e \n\n-----------------------------------------------------------------------\n\n\u003ca href=\"https://docs.unrealengine.com/5.3/en-US/\"\u003e \n  \u003cimg align=\"left\" alt=\"Unreal Engine Plugin\" src=\"https://img.shields.io/badge/Unreal%20Engine%20Plugin-black?style=for-the-badge\u0026logo=unrealengine\u0026logoColor=white\u0026color=black\u0026labelColor=black\"\u003e \u003c/a\u003e\n\u003ca href=\"https://jdsherbert.itch.io/dependency-injector-plugin\"\u003e \n  \u003cimg align=\"top\" alt=\"Available on Itch.io\"  src=\"https://img.shields.io/badge/Available%20on%20Itch.io-FF0B34.svg?style=for-the-badge\u0026logo=Itch.io\u0026logoColor=white\u0026color=black\u0026labelColor=FF0B34\"\u003e \u003c/a\u003e\n  \n\u003ca href=\"https://choosealicense.com/licenses/mit/\"\u003e \n  \u003cimg align=\"right\" alt=\"License\" src=\"https://img.shields.io/badge/License%20:%20MIT-black?style=for-the-badge\u0026logo=mit\u0026logoColor=white\u0026color=black\u0026labelColor=black\"\u003e \u003c/a\u003e\n  \n\u003cbr\u003e\u003c/br\u003e\n\n-----------------------------------------------------------------------\n## Overview\nDependency Injection (DI) is a design pattern widely used in software development to achieve a more flexible and maintainable codebase. In essence, dependency injection involves providing a component with its dependencies rather than allowing it to create them. This pattern is particularly prevalent in object-oriented programming and is beneficial for several reasons:\n\n#### Decoupling and Separation of Concerns:\nDependency Injection helps to decouple components, reducing the interdependence between different parts of the system.\nIt allows for a clear separation of concerns, making individual components focus on their specific responsibilities without having to worry about the creation and management of their dependencies.\n\n#### Testability:\nOne of the significant advantages of DI is improved testability. By injecting dependencies, it becomes easier to substitute real implementations with mock or fake objects during unit testing.\nTestability is enhanced because you can isolate and test individual components without dealing with their concrete dependencies.\n\n#### Flexibility and Reusability:\nDI promotes flexibility by making it easier to change or extend the behavior of a system. Components become more modular and can be replaced or upgraded without affecting the entire system.\nReusability is increased as components become less tightly coupled, making it possible to reuse them in different contexts or projects.\n\n#### Maintainability and Readability:\nCode maintainability improves as dependencies are explicitly defined and managed. This makes it easier for developers to understand the codebase and make changes without introducing unexpected side effects. The code becomes more readable because the dependencies required by a component are explicitly declared, providing a clear contract for how the component should be used.\n\n#### Easier Integration and Collaboration:\nDI facilitates the integration of third-party components or libraries. Components can be easily integrated by injecting their dependencies, reducing the effort required for collaboration between different parts of a system. It also aids in collaborating on large codebases as teams can work more independently on isolated components.\n\n#### Centralized Configuration and Control:\nDI allows for centralized control over the configuration and creation of components. Dependency injection containers or frameworks are often used to manage the creation and resolution of dependencies. Centralized control simplifies the configuration of the application and makes it easier to manage the lifecycle of components.\nIn practice, dependency injection is implemented in various ways, including constructor injection, method injection, and property injection\n\n-----------------------------------------------------------------------\n\n## Usage\nTo use the plugin:\n1. Copy the DependencyInjectorPlugin folder into your Unreal Engine project's Plugins directory.\n2. Enable the plugin in your project:\n   - Open your Unreal Engine project.\n   - Go to Edit \u003e Plugins.\n   - Find the DependencyInjectorPlugin in the list and enable it.\n   - Restart Unreal Engine if prompted.\n3. Open your IDE.\n4. Start writing some code!\n\nYou can use the injector in C++ as follows:\n\n```cpp\n//.h\n#pragma once\n\n#include \"CoreMinimal.h\"\n\n/**\n * Sample class to be registered with the Dependency Injector\n */\nclass YOURPROJECT_API MyClass\n{\npublic:\n    MyClass();\n    ~MyClass();\n\n    void MyFunction();\n};\n```\n```cpp\n//.cpp\n// MyClass.cpp\n\n#include \"MyClass.h\"\n\nMyClass::MyClass()\n{\n    // Constructor logic\n\n    // Registering this instance with the Dependency Injector\n    UDependencyInjector::RegisterObject(this);\n}\n\nMyClass::~MyClass()\n{\n    // Unregistering this instance from the Dependency Injector\n  // (note that this is important to do if not using UObjects, due to Garbage Collection antics)\n    UDependencyInjector::UnregisterObject(this);\n}\n\nvoid MyClass::MyFunction()\n{\n    // Function logic\n}\n```\n\n-----------------------------------------------------------------------\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdsherbert%2Funreal-engine-dependency-injection-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdsherbert%2Funreal-engine-dependency-injection-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdsherbert%2Funreal-engine-dependency-injection-plugin/lists"}