{"id":19758601,"url":"https://github.com/alvarogarcia7/kata-formulation-copy-program","last_synced_at":"2026-02-09T12:03:59.017Z","repository":{"id":69481196,"uuid":"92741790","full_name":"alvarogarcia7/kata-formulation-copy-program","owner":"alvarogarcia7","description":null,"archived":false,"fork":false,"pushed_at":"2017-05-29T17:38:44.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-11T21:34:42.798Z","etag":null,"topics":["dip","fake","kata","kata-boilerplate","kata-formulation","mock","solid-principles","stub"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alvarogarcia7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2017-05-29T13:18:17.000Z","updated_at":"2017-06-07T14:21:34.000Z","dependencies_parsed_at":"2023-04-07T20:47:11.410Z","dependency_job_id":null,"html_url":"https://github.com/alvarogarcia7/kata-formulation-copy-program","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alvarogarcia7/kata-formulation-copy-program","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvarogarcia7%2Fkata-formulation-copy-program","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvarogarcia7%2Fkata-formulation-copy-program/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvarogarcia7%2Fkata-formulation-copy-program/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvarogarcia7%2Fkata-formulation-copy-program/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alvarogarcia7","download_url":"https://codeload.github.com/alvarogarcia7/kata-formulation-copy-program/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvarogarcia7%2Fkata-formulation-copy-program/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29264177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T04:11:57.159Z","status":"ssl_error","status_checked_at":"2026-02-09T04:11:56.117Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["dip","fake","kata","kata-boilerplate","kata-formulation","mock","solid-principles","stub"],"created_at":"2024-11-12T03:25:15.217Z","updated_at":"2026-02-09T12:03:58.986Z","avatar_url":"https://github.com/alvarogarcia7.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kata Formulation: Copy Program\n\n## Description\n\n\u003e Consider a simple program that is charged\n\u003e with the task of copying characters typed on a keyboard to a printer. Assume, furthermore,\n\u003e that the implementation platform does not have an operating system that supports device\n\u003e independence. We might conceive of a structure for this:\n\n\u003e !['Copy Program' module diagram](./images/copy-program.png)\n\n\u003e Figure [above] is a \"structure chart\". It shows that there are three modules, or subprograms,\n\u003e in the application. The \"Copy\" module calls the other two. One can easily imagine a loop\n\u003e within the \"Copy\" module. The body of that loop calls the \"Read Keyboard\" module to fetch \n\u003e a character from the keyboard, it then sends that character to the \"Write Printer\" module \n\u003e which prints the character.\n\n\u003e extracted from [The Dependency Inversion Principle](https://drive.google.com/file/d/0BwhCYaYDn8EgMjdlMWIzNGUtZTQ0NC00ZjQ5LTkwYzQtZjRhMDRlNTQ3ZGMz/view), by Robert C. Martin\n\n## Problem\n\nYour task, should you accept it, is to write a program that performs the above-descripted\naction.\n\nBear in mind that we are not sure where to 'read' from. Neither where we want to write to.\n\nThese are the APIs we want to have:\n\n```java\nclass ReadKeyboard {\n  public boolean hasNext();\n  public String  get();\n}\n```\n\n```java\nclass WritePrinter {\n  public void print(String message);\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvarogarcia7%2Fkata-formulation-copy-program","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falvarogarcia7%2Fkata-formulation-copy-program","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvarogarcia7%2Fkata-formulation-copy-program/lists"}