{"id":14960833,"url":"https://github.com/k0dep/stator","last_synced_at":"2025-10-24T19:30:31.024Z","repository":{"id":121120444,"uuid":"202413267","full_name":"k0dep/stator","owner":"k0dep","description":"💉IoC container that uses code generation instead of reflection for managing and resolving dependencies as a basis","archived":false,"fork":false,"pushed_at":"2019-09-13T10:21:52.000Z","size":160,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-28T20:58:52.879Z","etag":null,"topics":["code-generation","codegeneration","ioc-container","originer","unity-package-manager","unity3d"],"latest_commit_sha":null,"homepage":"","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/k0dep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-08-14T19:28:43.000Z","updated_at":"2022-05-19T14:16:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"b8205161-5705-48cf-af8e-59c0ae7263fc","html_url":"https://github.com/k0dep/stator","commit_stats":{"total_commits":26,"total_committers":1,"mean_commits":26.0,"dds":0.0,"last_synced_commit":"eeb6804e3bc30a60c47efbda4bb143cf58d13bf3"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":"k0dep/upm-template-package","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0dep%2Fstator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0dep%2Fstator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0dep%2Fstator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0dep%2Fstator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k0dep","download_url":"https://codeload.github.com/k0dep/stator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219868059,"owners_count":16555878,"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":["code-generation","codegeneration","ioc-container","originer","unity-package-manager","unity3d"],"created_at":"2024-09-24T13:23:09.071Z","updated_at":"2025-10-24T19:30:25.661Z","avatar_url":"https://github.com/k0dep.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"💉Stator IoC container\n====================\n\nStator is an IoC container that uses code generation instead of reflection for managing and resolving dependencies as a basis.\n\u003e This repository is a UPM package.\n\nExample\n-------\n\n1. Add TestFactory *partial* class\n\n```csharp\nusing Stator;\n\nnamespace StatorExample\n{\n    public partial class TestFactory : ContainerFactory\n    {\n        public TestFactory()\n        {\n            AddTransient\u003cFoo\u003e();\n            AddTransient\u003cBar\u003e();\n        }\n    }\n\n    public class Foo { }\n\n    public class Bar\n    {\n        public Foo Foo;\n        public Bar(Foo foo)\n        {\n            Foo = foo;\n        }\n    }\n}\n```\n\n2. Focus unity editor for triger generation process, after compilation will generated partial classes in `./Assets/stator_generated/`\n\n3. Use container:\n```csharp\nusing StatorExample;\nusing UnityEngine;\nusing UnityEngine.Assertions;\n\npublic class SceneTest : MonoBehaviour\n{\n    void Start()\n    {\n        var container = new TestFactory();\n        var bar = container.Resolve\u003cBar\u003e();\n        Assert.IsNotNull(bar);\n        Assert.IsNotNull(bar.Foo);\n        Debug.Log(\"Ok\");\n    }\n}\n```\n\n4. Enjoy!\n\nPerformance\n-----------\n\nPerformance testing was carried out on a PC and an Android device and \nnot a development build. As a comparison, the ioc container `Zenject` 8.0.0 version was selected.\n\nDevice configurations:\n * PC: Laptop Huawei Matebook 13, intel core i5 8th, 8gb ddr4 ram.\n * Android device: Xiaomi Redmi Note 4 MTK\n\nResult:\n\n![benchmark](Docs~/stator-zenject-benchmark.png)\n\nSettings\n--------\n\nTo configure you need to add the file `.stator` to the root project folder. Config structure like ini file.  \nOptions:\n\n|            Key          |                             Values                                   |\n|-------------------------|--------------------------------------------------------------------- |\n| AutoGeneratedFolder     | Relative path to the folder where the generated files will be stored |\n| EnableDebugging         | true - enable debug logs                                             |\n| DisabledAutoRefreshing  | true - auto generation will be disabled                              |\n\nTo manual start the code generation process, click the button in the window in `Window/Stator/Options`\n\nUsing\n-----\n\nTo start using this package add a line to your `./Packages/manifest.json` like next sample:  \n```json\n{\n  \"dependencies\": {\n    \"pro.kodep.stator\": \"https://github.com/k0dep/stator.git\"\n  }\n}\n```\n\nOr use it as dependency from another packages and auto include by [Originer](https://github.com/k0dep/Originer) package\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk0dep%2Fstator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk0dep%2Fstator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk0dep%2Fstator/lists"}