{"id":23756626,"url":"https://github.com/tedyoung/toward-domain-java8","last_synced_at":"2025-03-15T11:14:26.085Z","repository":{"id":41115879,"uuid":"508378049","full_name":"tedyoung/toward-domain-java8","owner":"tedyoung","description":"Exercise for moving away from Anemic Domain.","archived":false,"fork":false,"pushed_at":"2022-07-05T14:39:33.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-08T02:04:52.188Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/tedyoung.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":"2022-06-28T16:36:39.000Z","updated_at":"2023-03-08T05:12:18.000Z","dependencies_parsed_at":"2022-09-09T21:30:21.450Z","dependency_job_id":null,"html_url":"https://github.com/tedyoung/toward-domain-java8","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tedyoung%2Ftoward-domain-java8","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tedyoung%2Ftoward-domain-java8/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tedyoung%2Ftoward-domain-java8/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tedyoung%2Ftoward-domain-java8/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tedyoung","download_url":"https://codeload.github.com/tedyoung/toward-domain-java8/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243719399,"owners_count":20336607,"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-12-31T19:17:19.674Z","updated_at":"2025-03-15T11:14:26.067Z","avatar_url":"https://github.com/tedyoung.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Anemic Data Model Exercise\n\nA legacy refactor exercise, focused on the violation of Andy Hunt's [tell don't ask](https://toolshed.com/articles/1998-07-01-TellDontAsk.html) heuristic (also see [Fowler](https://martinfowler.com/bliki/TellDontAsk.html)) principle and suffering from an [anemic domain model](https://martinfowler.com/bliki/AnemicDomainModel.html).\n\n## Instructions\nHere you find a simple order flow application.\nIt's able to create orders, do some calculations (totals and taxes), and manage them (approve/reject and ship).\n\nThe old development team did not find the time to build a proper domain model,\nbut instead preferred to use a procedural style, building this anemic domain model.\nFortunately, they did at least take the time to write unit tests for the code.\n\nYour new CTO, after many bugs caused by this application,\nasked you to refactor this code to make it more maintainable and reliable.\n\n## What to focus on\nFocus on code smells, such as _Feature Envy_, _Primitive Obsession_, and Data focus instead of Domain focus.\n\n### Remove Setters\n\nYou should be able to remove all the setters moving the behavior into the domain objects (_Feature Envy_ perhaps?).\n\nBut don't stop there.\n\nIf you can remove some test cases because they don't make sense anymore (e.g.: you cannot compile the code to do the wrong thing) feel free to do it!\n\n## Contribute\nIf you would like to contribute to this exercise adding new cases or smells: please open a pull request!\n\n## Feedback\nFeedback is welcome!\n\nHow did you find the exercise? Did you learn anything from it?\n\nPlease contact me on Twitter [@JitterTed](https://twitter.com/jitterted) or use the GitHub repo wiki!\n\n## History\n\n\u003e This was originally forked from https://github.com/racingDeveloper/tell-dont-ask-kata -- [@racingDeveloper](https://twitter.com/racingDeveloper) on Twitter.\n\u003e\n\u003e I've updated JUnit to the JUnit 5, and replaced Hamcrest, etc. with AssertJ assertions.\n\u003e\n\u003e Also replaced references to \"kata\" to be \"exercise\"\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftedyoung%2Ftoward-domain-java8","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftedyoung%2Ftoward-domain-java8","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftedyoung%2Ftoward-domain-java8/lists"}