{"id":18682876,"url":"https://github.com/yandex/scout","last_synced_at":"2025-04-12T04:24:24.293Z","repository":{"id":198161364,"uuid":"698181481","full_name":"yandex/scout","owner":"yandex","description":"A fast and safe manual dependency injector for Kotlin and Android.","archived":false,"fork":false,"pushed_at":"2023-12-07T09:13:55.000Z","size":262,"stargazers_count":114,"open_issues_count":2,"forks_count":4,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-26T00:01:44.692Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yandex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-29T10:42:38.000Z","updated_at":"2025-03-15T15:30:18.000Z","dependencies_parsed_at":"2023-10-12T17:40:11.740Z","dependency_job_id":"bbbd44c6-9cb0-4d03-8ab9-b0048af10acb","html_url":"https://github.com/yandex/scout","commit_stats":null,"previous_names":["yandex/scout"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yandex%2Fscout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yandex%2Fscout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yandex%2Fscout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yandex%2Fscout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yandex","download_url":"https://codeload.github.com/yandex/scout/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248515018,"owners_count":21117094,"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":[],"created_at":"2024-11-07T10:13:04.303Z","updated_at":"2025-04-12T04:24:24.269Z","avatar_url":"https://github.com/yandex.png","language":"Kotlin","funding_links":[],"categories":["IoC"],"sub_categories":[],"readme":"\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"./docs/assets/scout-logo-dark.png\"\u003e\n  \u003cimg src=\"./docs/assets/scout-logo-light.png\" alt=\"Swift logo\" height=\"70\"\u003e\n\u003c/picture\u003e\n\n\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\n\n[![Maven Central][mavenbadge-svg]][mavencentral]\n\nA fast and safe manual dependency injector for Kotlin and Android.\n\nScout is a runtime dependency injection library. It provides excellent Domain Specific \nLanguage for factory declarations and configurable dependency graph validator. The dependency \ngraph resolves it's nodes really fast despite the runtime approach.\n\nScout is actively maintained by Yandex. The library is currently in beta, as we want to get \nfeedback from users and to test a couple of promissing ideas. The library API is quite stable, \nbut we do not exclude the possibility that we will make minor changes to it.\n\n## Usage\n\nActually Scout is a dependency container, so let's fill that container with some definitions. \nScope is responsible for storing definitions and created instances.\n```kotlin\nval appScope = scope(\"app-scope\") {\n    singleton\u003cBooksDataStore\u003e {\n        BooksDataStore()\n    }\n    reusable\u003cBookMapper\u003e {\n        BookMapper()\n    }\n    factory\u003cBooksRepository\u003e {\n        BooksRepository(store = get(), mapper = get())\n    }\n}\n```\n\nScope prohibits random access to it's content. The only way to get some instance from scope is \nto declare component.\n```kotlin\nobject AppComponent : Component(appScope) {\n    fun repository(): BooksRepository = get()\n}\n```\n\nAs soon as component is instantiated we are able to access our dependency graph.\n```kotlin\nfun main() = AppComponent\n    .repository()\n    .sync()\n```\n\nOur program is ready, let's test the dependency graph.\n```kotlin\nclass DependencyGraphTest {\n    @Test\n    fun `Check dependency graph is consistent`() {\n        Validator.configure()\n            .withConsistencyCheck()\n            .validate(ComponentCollector())\n    }\n}\n```\n\nNow every new component in our program will be automatically collected for testing.\n```\nValidate 1 components using ConsistencyChecker\n ✔ Consistency check passed without errors\n```\n\n## Setup\n```groovy\n// Gradle: build.gradle\ndependencies {\n    implementation \"com.yandex.scout:scout-core:$scout_version\" // main library\n    testImplementation \"com.yandex.scout:scout-validator:$scout_version\" // validator and built-in checks\n    testImplementation \"com.yandex.scout:classgraph-collector:$scout_version\" // built-in component collector\n}\n```\n\n## Tutorials\n\n- [Quick Start](docs/quick-start-guide.md)\n- [Scope Anatomy](docs/scope-anatomy.md)\n- [Essential Rules](docs/essential-rules.md)\n- [Validation Guide](docs/validation.md)\n- [Multibindings](docs/multibindings.md)\n- [Lazy and Provider](docs/deferred-requests.md)\n- [Optimizations](docs/optimizations.md)\n- [Benchmarks](docs/benchmarks.md)\n\n## License\n```\nCopyright 2023 Yandex LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\n[mavenbadge-svg]: https://badgen.net/maven/v/maven-central/com.yandex.scout/scout-core\n[mavencentral]: https://search.maven.org/artifact/com.yandex.scout/scout-core\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyandex%2Fscout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyandex%2Fscout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyandex%2Fscout/lists"}