{"id":20340562,"url":"https://github.com/strongself/cooperation","last_synced_at":"2025-08-24T05:04:49.505Z","repository":{"id":56904990,"uuid":"72947982","full_name":"strongself/COOperation","owner":"strongself","description":"Your service implementation is a cooperation of your Core-components.","archived":false,"fork":false,"pushed_at":"2017-08-21T09:25:27.000Z","size":176,"stargazers_count":55,"open_issues_count":5,"forks_count":6,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-08-23T22:11:44.018Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-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/strongself.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}},"created_at":"2016-11-05T19:16:35.000Z","updated_at":"2023-03-30T22:15:23.000Z","dependencies_parsed_at":"2022-08-21T02:50:25.877Z","dependency_job_id":null,"html_url":"https://github.com/strongself/COOperation","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/strongself/COOperation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strongself%2FCOOperation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strongself%2FCOOperation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strongself%2FCOOperation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strongself%2FCOOperation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strongself","download_url":"https://codeload.github.com/strongself/COOperation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strongself%2FCOOperation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271795054,"owners_count":24822635,"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","status":"online","status_checked_at":"2025-08-24T02:00:11.135Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-14T21:22:35.386Z","updated_at":"2025-08-24T05:04:49.465Z","avatar_url":"https://github.com/strongself.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://habrastorage.org/files/3c5/4cd/4e1/3c54cd4e189e4c76b4cb2b39e7c126ec.gif\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eYour service implementation is a cooperation of your core components\u003c/b\u003e\n\u003c/p\u003e\n\n![Version](https://img.shields.io/badge/version-0.0.2-brightgreen.svg)\n![License](https://img.shields.io/badge/license-MIT-blue.svg)\n![Test Coverage](https://img.shields.io/badge/Test%20Coverage-55%25-orange.svg)\n![Status](https://img.shields.io/badge/status-alpha-orange.svg)\n\n**COOperation** is a component for organizing and structuring the code of your service layer with the help of *NSOperation*.\n\n|         | Key Features|\n|---------|---------------|\n|\u0026#127984; | Design beautiful and reusable business logic|\n|\u0026#128591; | Follow the SOLID principles out of the box|\n|\u0026#127823; | Use the *Compound Operations* concept introduced by Apple at WWDC 2015 ([Advanced NSOperations](https://developer.apple.com/videos/play/wwdc2015/226/))\n|\u0026#9745;   | Write unit and integration tests easily|\n\n**COOperation** is written in Objective-C with full Swift interop support. By the way, we are working on a Swift version!\n\n## Installation\n\n### Cocoapods\n\nThe preferred installation method for `COOperation` is with [CocoaPods](http://cocoapods.org). Simply add the following to your Podfile:\n\n```ruby\n# Latest release of COOperation\npod 'COOperation'\n```\n\n## Usage\n\n### Creating your \"Chainable Operation\"\n\n```swift\nimport Foundation\nimport CompoundOperations\n\n/// Chainable operation that performs network request\nclass NetworkRequestChainableOperation: ChainableOperationBase {\n    \n    /// Network client (Core-component)\n    private let networkClient: NetworkClient\n    \n    init(networkClient: NetworkClient) {\n        self.networkClient = networkClient\n        \n        super.init()\n    }\n    \n    // MARK: Executing\n    \n    override func inputDataClass() -\u003e AnyClass? {\n        return NSURLRequest.self\n    }\n    \n    override func processInputData(inputData: AnyObject?,\n                                   completionBlock: ChainableOperationBaseOutputDataBlock) {\n        \n        let inputRequest = inputData as! NSURLRequest\n        \n        networkClient.performRequest(inputRequest) { (data, error) in\n            completionBlock(data, error)\n        }\n    }\n}\n```\n\n### Creating your \"Compound Operation\"\n\n```swift\n    func obtainDataCompoundOperation(withResultBlock resultBlock: CompoundOperationResultBlock?) -\u003e CompoundOperation {\n        let networkRequestOperation = NetworkRequestChainableOperation(networkClient: NetworkClientImplementation())\n        let deserializationOperation = DeserializationChainableOperation(deserializer: JSONDeserializer)\n\n        let chainableOperations = [\n            networkRequestOperation,\n            deserializationOperation\n        ]\n        \n        let operation = CompoundOperation.defaultCompoundOperation()\n        operation.configureWithChainableOperations(chainableOperations,\n                                                   resultBlock: resultBlock)\n        \n        return operation\n    }\n```\n\n### Using your \"Compound Operation\" in your services\n\n```swift\n    let compoundOperation = obtainDataCompoundOperation { (data, error) in\n        // Process the result\n    }\n    \n    queue.addOperation(compoundOperation) // OR compoundOperation.start()\n```\n\n### Author\n\n- Gleb Novik, Egor Tolstoy and the rest of [Rambler.iOS team](https://github.com/orgs/rambler-digital-solutions/teams/ios-team).\n\n### License\n\nMIT\n\n### Thanks\n\n[Sergey Simanov](https://dribbble.com/SlmacH) - impressive logo design.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrongself%2Fcooperation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrongself%2Fcooperation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrongself%2Fcooperation/lists"}