{"id":34948080,"url":"https://github.com/acidmanic/my-oc-container","last_synced_at":"2026-05-23T06:02:24.468Z","repository":{"id":54856213,"uuid":"134890410","full_name":"Acidmanic/my-oc-container","owner":"Acidmanic","description":"This project is supposed to be a very lightweight, easy to use and independent IOC container for small to medium scale projects.","archived":false,"fork":false,"pushed_at":"2021-01-25T03:58:35.000Z","size":1555,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-07-06T21:43:49.715Z","etag":null,"topics":["ioc-container","java","java-library","lightweight","lightweight-framework"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Acidmanic.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-25T18:18:40.000Z","updated_at":"2024-06-25T12:15:21.000Z","dependencies_parsed_at":"2022-08-14T04:50:45.069Z","dependency_job_id":null,"html_url":"https://github.com/Acidmanic/my-oc-container","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Acidmanic/my-oc-container","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acidmanic%2Fmy-oc-container","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acidmanic%2Fmy-oc-container/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acidmanic%2Fmy-oc-container/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acidmanic%2Fmy-oc-container/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Acidmanic","download_url":"https://codeload.github.com/Acidmanic/my-oc-container/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acidmanic%2Fmy-oc-container/sbom","scorecard":{"id":8225,"data":{"date":"2025-08-11","repo":{"name":"github.com/Acidmanic/my-oc-container","commit":"40c5a36b660748b5014b884e53e7b74f5f14d040"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/19 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v1.0.0 not signed: https://api.github.com/repos/Acidmanic/my-oc-container/releases/13993009","Warn: release artifact v1.0.0 does not have provenance: https://api.github.com/repos/Acidmanic/my-oc-container/releases/13993009"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-14T14:02:09.726Z","repository_id":54856213,"created_at":"2025-08-14T14:02:09.727Z","updated_at":"2025-08-14T14:02:09.727Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33384605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T04:15:53.637Z","status":"ssl_error","status_checked_at":"2026-05-23T04:15:53.242Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ioc-container","java","java-library","lightweight","lightweight-framework"],"created_at":"2025-12-26T20:54:07.545Z","updated_at":"2026-05-23T06:02:24.459Z","avatar_url":"https://github.com/Acidmanic.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Codacy Badge](https://api.codacy.com/project/badge/Grade/77f9cb43152b4be7963515bbf0b9e119)](https://app.codacy.com/manual/Acidmanic/my-oc-container?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=Acidmanic/my-oc-container\u0026utm_campaign=Badge_Grade_Dashboard)\n[![Build Status](https://travis-ci.org/Acidmanic/my-oc-container.svg?branch=develop)](https://travis-ci.org/Acidmanic/my-oc-container)\n![License](https://img.shields.io/badge/license-GPL--3.0-blue.svg)\n\n---------\n\n\u003cimg src=\"https://maven.apache.org/images/maven-logo-black-on-white.png\" width=\"90px\" height=\"26px\" /\u003e  \u003cimg src=\"https://raw.githubusercontent.com/gradle/gradle/master/gradle.png\" width=\"100px\" height=\"32px\" /\u003e\n\n-----\n\n\nAbout\n===== \n\nMyOcContainer (My IOC Container) is supposed to be a very simple and lightweight  IOC container with mandatory features for a small, to medium scale project.  \n\n\n\nDownload\n======\n\nMyOc Container is available on maven central. you can add a maven dependency in your pom.xml file using this snippet:\n\n(JDK 1.8)\n\n```xml\n\t\u003cdependency\u003e\n\t\t\u003cgroupId\u003ecom.acidmanic\u003c/groupId\u003e\n\t\t\u003cartifactId\u003emyoccontainer\u003c/artifactId\u003e\n\t\t\u003cversion\u003e1.1.2\u003c/version\u003e\n\t\u003c/dependency\u003e\n```\nthere is also a fork build for JDK 1.6:\n\n```xml\n\t\u003cdependency\u003e\n\t\t\u003cgroupId\u003ecom.acidmanic\u003c/groupId\u003e\n\t\t\u003cartifactId\u003emyoccontainer16\u003c/artifactId\u003e\n\t\t\u003cversion\u003e1.0.1\u003c/version\u003e\n\t\u003c/dependency\u003e\n```\n\nand to be used in gradle (JDK 1.8):\n\n```\n\tcompile 'com.acidmanic:myoccontainer:1.1.2'\n```\nand JDK 1.6:\n\n```\n\tcompile 'com.acidmanic:myoccontainer16:1.1.2'\n```\n\n**Jar package:** You can also get  [Latest Release](https://github.com/Acidmanic/my-oc-container/releases/latest)   from git-hub releases page. Simply download the **myoc-container.jar** from the release page and add it to your project classpath.\n\n\nHow To Use \n========== \n**Register then Resolve**!\n\nFirst you will create and instance of the clas **Resolver**, which is the main IOC object. The **Resolver** class is *NOT* a singleton therefore you can have different resolvation profiles in your project. but in most cases, a singleton is the best fit.\nWith your **Resolver** object created, first you will configure it to know how to resolve each class by calling over-rides of register() method. After that, your resolver object can be used in project to produce your objects.\n\n\nHow To Use - Register (Configure):\n-------------\n\nyou can register all of your in-use classes by calling one of the  overloads of the method _register(.)_.\n\nYou can register different implementations for each class by providing  a tag parameter for _register_ method. a tag should be a string conforming to the convention of c-like languages variable names except it can have '-' and '.' in it.\n\nIt also supports a fluent-like syntax. to register classes with you preference via a fluent syntax, you can call the _register()_ method without any arguments. then you can set any of the properties using provided functions:\n\n|        Method   |                                                                                                    |\n|:------------------|:-------------------------------------------------------------------------------|\n|\tbind(.)      |\tsets the class you want to choose an implementation for |\n|    to(.)   \t\t |  sets the class that would be the implementation |\n|   bindToSelf(.) | configures the resolver to resolve as class to itself. In other words, ``` resolver.register().bindToSelf(A.class)``` is equivalent to ``` resolver.register().bind(A.class).to(A.class)``` |\n|  taggedAs(.)   |  will set a tag for this registration |\n|  livesAsA(.)     |  will take a LifetimeType argument to set the type of lifetime you want to use. |\n|   withBuilder(.)  |   will register a builder to create the object.|\n\nYou can perform a small life time management for objects by providing a __LifetimeType__ parameter to the _register_ method. LifetimeType currently can be __Transient__ (default) or __Singleton__. all singleton objects will be stored inside the  __Resolver__ object. and resolver itself is not a singleton so you can have multiple scopes in your application.\n\nYou can call withBuilder(.) method, passing it an implementation of __Builder__ interface. you can also call this method by an inline implementation (anonymous class) of the __Builder__ interface. the main difference is that with the dependency created using first approuch can be saved in a config file, but by using an anonymous class (or a lambda expression), it would not be possible, and the dependency will be ommited when you save configurations.\n\nYou can create an installer calss by implementing the __Installer__ interface. such a class will contain a _configure(Registerer myoc)_ method where you can put all your configuration lines. the __Registerer__ argument of the _configure(.)_ method provides the fluent syntax registration methods.\n\n\nHow To Use - Resolve:\n--------------------------\n\n\nto create an object, you should call on of the _resolve_ methods from __Resolver__ object. different _resolve_ methods will  resolve the given type with different strategies. for example, _resolveByTagOnly_ will resolve the class only if it's pre-registered with the given tag.  It's also possible to save resolver configurations to a file or load them from a file.\n\nTo load configurations from a pre-saved file, You can create the __Resolver__ object using its constructor which takes a string filePath parameter. the filePath would be the path to  the configuration file. configuration file is a white-space separated text file. each line will register one class. classes which are registered with  no tags, will have the default tag: \"Default\".\n\nFor saving the configurations, you can call the static method _save(.)_ from class __ConfigurationFile__. it takes a filePath argument and another argument of type  __DependancyDictionary__. a __DependancyDictionary__ object can be created and populated in code or you can get the object from an already configured resolver through its  _getRegisteredDependancies()_ method.\n\nThere is a _resolveAll(.)_ method in __Resolver__ class wich will return an array of objects. the array contains one resolved object for each dependency registered for a given class.\n\n\nExample Code \n============  \n\nconsider we have the class __A__. which takes an argument of type __b__ and another argument of type __c__ in its constructor. where __b__ and __c__ are your abstractions. then you might have implementations __B1__ and __B2__ for __b__ and __C1__ and __C2__ for __c__.\na simple demo code would be like this:\n\n```java\n\n//Creating a resolver\nResolver resolver = new Resolver();\n\n// Configuring your resolver - normal argument call\n\nresolver.register(A.class, A.class);\nresolver.register(A.class, A.class,\"fancyOne\",LifetimeType.Singleton);\nresolver.register(b.class, B1.class);               // as default\nresolver.register(b.class, B2.class,\"fancyOne\");    // fancy implementation\nresolver.register(c.class, C1.class);               // default\nresolver.register(c.class, C2.class,\"fancyOne\");    // fancy\n\n// Configuring your resolver - fluent like syntax\n\nresolver.register().bindToSelf(A.class);  \nresolver.register().bindToSelf(A.class).taggedAs(\"fancyOne\").livesAsA(LifetimeType.Singleton); \nresolver.register().bind(b.class).to(B1.class);  \nresolver.register().bind(b.class).to(B2.class).taggedAs(\"fancyOne\");  \nresolver.register().bind(c.class).to(C1.class);  \nresolver.register().bind(b.class).to(C2.class).taggedAs(\"fancyOne\");  \n\n// Using resolver\n\n\n// this will make a transient A object with default implementation.\n\nA aDefaultImplementation = resolver.resolve(A.class);\n\n// this will make an A object with fancy implementation.\n// this object will be a singleton.\n\nA aFancyImplementation = resolver.resolve(A.class,\"fancyOne\"); \n\n\n```\n\n**Note:**\nWhen you use the resolver to resolve a class to an object, you can also use *resolver.tryResolve(.)* methods instead of *resolver.resolve(.)* methods. The difference is that tryResolve(.) methods will not throw an exception, and instead they will return a null when they caught a problem resolving the given class.\n\n__More Examples__\n\nIf you downloaded the code, you can take a look at test codes in the project in the package _test.myoccontainer.*_.\n\n\n\u003cp\u003eGood luck\u003c/p\u003e\n\u003cp\u003eMani\u003c/p\u003e   \n\n__Contact:__\n\nacidmanic.moayedi@gmail.com         ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facidmanic%2Fmy-oc-container","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facidmanic%2Fmy-oc-container","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facidmanic%2Fmy-oc-container/lists"}