{"id":26924504,"url":"https://github.com/klee0kai/stone","last_synced_at":"2026-04-12T01:12:00.994Z","repository":{"id":65291252,"uuid":"525936862","full_name":"klee0kai/stone","owner":"klee0kai","description":"DI disigned by weak references","archived":false,"fork":false,"pushed_at":"2024-06-02T08:24:30.000Z","size":1443,"stargazers_count":4,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2024-06-02T09:37:57.920Z","etag":null,"topics":["android","dependency-injection","java","kotlin"],"latest_commit_sha":null,"homepage":"https://github.com/klee0kai/stone/wiki","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/klee0kai.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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},"funding":{"custom":["https://buymeacoffee.com/klee0kai"]}},"created_at":"2022-08-17T20:01:42.000Z","updated_at":"2024-06-02T09:38:12.959Z","dependencies_parsed_at":"2023-02-16T23:15:50.029Z","dependency_job_id":"bdfa4294-3a13-4c6c-a834-a3004b444c0e","html_url":"https://github.com/klee0kai/stone","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klee0kai%2Fstone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klee0kai%2Fstone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klee0kai%2Fstone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klee0kai%2Fstone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/klee0kai","download_url":"https://codeload.github.com/klee0kai/stone/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246741108,"owners_count":20826064,"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":["android","dependency-injection","java","kotlin"],"created_at":"2025-04-02T01:54:19.996Z","updated_at":"2026-04-12T01:12:00.984Z","avatar_url":"https://github.com/klee0kai.png","language":"Java","funding_links":["https://buymeacoffee.com/klee0kai"],"categories":[],"sub_categories":[],"readme":"# Stone\n\n[![](https://github.com/klee0kai/stone/actions/workflows/deploy_dev.yml/badge.svg)](https://github.com/klee0kai/stone/actions/workflows/deploy_dev.yml)\n[![](https://img.shields.io/badge/license-GNU_GPLv3-blue.svg?style=flat-square)](./LICENCE.md)\n[![](https://jitpack.io/v/klee0kai/stone.svg)](https://jitpack.io/#klee0kai/stone)\n\n\n[![](https://img.shields.io/badge/Platform-Android-brightgreen)]()\n[![](https://img.shields.io/badge/Platform-java-orange)]()\n[![](https://img.shields.io/badge/Platform-Kotlin-blue)]()\n\nA DI library designed for jvm programs, working on the basis of various types of links: weak, soft, strong.\nThe main goal of the library is to decouple DI from the need to work with the life cycles of application components,\ntransfer the work of the life cycle to the components themselves from the life cycle\n\nRead more about the  solution ideology [wiki](https://github.com/klee0kai/stone/wiki)\n\n## Quick start\n\nQuick start on [java](https://github.com/klee0kai/stone/wiki/java_start).\nFor [kotlin](https://github.com/klee0kai/stone/wiki/kotlin_start).\nAll examples are gradle oriented.\n\nThe library is supplied via the `jitpack` repository.\n\n```kotlin \ndependencyResolutionManagement {\n    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n    repositories {\n        maven(url = \"https://jitpack.io\")\n    }\n}\n```\n\nIn the project module, import dependencies\n\n```kotlin\ndependencies {\n    // stone\n    implementation(\"com.github.klee0kai.stone:stone_multiplatform:2.1.0\")\n    ksp(\"com.github.klee0kai.stone:stone_ksp:2.1.0\")\n}\n```\n\nSimple usage boils down to declaring a grant object\n\n```kotlin\n@Module\nabstract class PlanetsModule {\n\n    @Provide(cache = Provide.CacheType.Soft)\n    abstract fun earth(): Earth \n\n}\n\n@Component\ninterface PlanetsComponent {\n\n    fun planets(): PlanetsModule\n\n}\n```\n\nAnd further use.\n\n```kotlin \nval DI: PlanetsComponent = PlanetsComponentStoneComponent()\nfun main(args: Array\u003cString\u003e) {\n    val earth = DI.planets().earth()\n}\n```\n\n## Introduction\n\nThe philosophy of the library is that it does not hold any objects by itself.\nHowever, if the object is not destroyed in the GC, then it can be reused.\nObjects in Stone are held only by the consumers of these very objects.\nIf the consumer stops using the object, the object may be destroyed.\n\nThis approach allows you to get rid of intermediaries working with DI,\nadditional integrations for example in navigation.\nIt also saves the application from using various managers \nand custom object providers in areas where DI usually couldn’t cope.\n\nDI should be one factory that provides the creation of all the main application objects.\n\n## Features\n\n### Blurred scopes\n\nThe library relieves the developer of the need to describe the scope of using a local singleton in a project.\nThe life of each object is determined only by its consumers, who retain it in memory.\n\n### Memory hot swap\n\nIn Stone, you can gracefully replace object factories at runtime.\nReplace bindings and extend the DI component.\nAll this allows you to implement dynamic application features.\nFlexibly develop UI testing using substitute mock data.\n\n### Qualifiers and Identifiers\n\nUnlike conventional DI implementations, Stone supports not only qualifiers, but also object identifiers.\nIdentifiers allow you to create and distinguish more and more local singletons in an unlimited number.\nAnd blurred scopes ensure that instances are properly cleaned as they are released.\n\n### Gradual warm-up\n\nThe library supports the use of provider wrappers.\nThis allows you to lazily initialize class instances or use the 2nd thread to do this.\nYou can also implement your own wrapper to work through kotlin delegates\nor to implement initialization in coroutine scopes.\n\n## Documentation \n\nDocumentation with examples\n - [Kotlin](https://github.com/klee0kai/stone/wiki/kotlin_start)\n\n## License\n\n```\nCopyright (c) 2022 Andrey Kuzubov\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklee0kai%2Fstone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklee0kai%2Fstone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklee0kai%2Fstone/lists"}