{"id":15944176,"url":"https://github.com/dimasmith/ddd-example","last_synced_at":"2025-03-14T18:42:23.059Z","repository":{"id":75302486,"uuid":"62400911","full_name":"dimasmith/ddd-example","owner":"dimasmith","description":"Snooker application example build with (hopefuly) DDD principles in mind","archived":false,"fork":false,"pushed_at":"2020-05-18T21:26:39.000Z","size":211,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"dev","last_synced_at":"2025-01-21T11:45:01.282Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dimasmith.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":"2016-07-01T15:03:05.000Z","updated_at":"2020-05-18T21:22:55.000Z","dependencies_parsed_at":"2023-02-25T20:15:12.865Z","dependency_job_id":null,"html_url":"https://github.com/dimasmith/ddd-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimasmith%2Fddd-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimasmith%2Fddd-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimasmith%2Fddd-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimasmith%2Fddd-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimasmith","download_url":"https://codeload.github.com/dimasmith/ddd-example/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243628709,"owners_count":20321904,"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-10-07T08:21:28.969Z","updated_at":"2025-03-14T18:42:23.051Z","avatar_url":"https://github.com/dimasmith.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"DDD Example - Snooker League\n============================\n\n# Domain\nI want to maintain (imaginary) Ukrainian professional Snooker league.\nThere are few aspects that are interesting to track:\n* Tournament calendar;\n* Player rankings;\n* Player statistics;\n* Match and tournament statistics;\n\n# Ranking and Tournaments\n\nSnooker league provides set of tournaments and calculate player rankings based on players performance on tournament.\n`Tournament` is an annual event where players participate and earn ranking points for wins.\nSet of tournaments are grouped into `Season`.\nSeason usually spans for a year (most often is starts on September and ends on May).\n\nEach season there are 96 `Players` participating.\nThey are trying to achieve maximum amount of ranking points.\n`Ranking points` adds up for two latest seasons (points of previous seasons are discarded).\nPlayer who has most ranking points after the end of season becomes a `Champion`.\nRanking points are added for each `Match` won during tournament.\nLater stage wins brings more points to winner.\nActual amount of points for winning a match differs for each tournament.\n\nAll details regarding ranking and tournaments are managed by `League Managers`.\n\n## Tournament\nTournament spans for a few days thus having start and end date.\nTournament consist of stages going one after another.\nProgressing to later stage is done on play-off basis.\nTwo player plays match.\nWinners goes to the next stage and loser is out of tournament.\nLast winner becomes tournament champion and gets most ranking points.\n\n### Seeded players\nDepending on tournament size few highest-ranked players are participating without going through qualification.\nThose players starting in later stages thus it is easier for them to get more ranking points.\nThere are 16 `seeded players` for `small` tournaments and 32 for `large` ones.\nSeeded players starts their games with ones who passed qualification.\n\n### Qualification\nPlayers who are not seeded are going through qualification.\nPairs of players in qualification are formed in random order.\nProgressing for each round of qualification gives exactly the same amount of ranking points.\nFor small tournaments there are 80 player who are not seeded.\nThus it is impossible to form normal play-off grid of them.\n16 players are randomly selected to participate only in last round of qualification.\nIt is easier for them to go to later stages but they're missing opportunity to win additional points in qualification.\n\n### Ranking update\nRankings are updated after tournament finishes.\nThose updates are taken into account when seeding for next tournament.\nEven if player through the course of qualification earns more points than currently seeded player it does not change seeding for ongoing tournament.\nTournament must not take place in the same time.\nNo time overlapping allowed.\n\n### Tournament grid\nPlacement __todo: add details__\n\n## Match\nMatch is a game between two players.\nOne player wins match, other one looses.\nMatch consists of `Frames`.\nEach won frame adds one point to players `Match Score`.\nMatch has pre-defined winning score.\nE.g. Match to 10 wins ends when either of players won 10 frames.\nEach match in the same tournament stage has the same length.\nMatches of different stages, however, may have different length (usually final match is longest one).\nMatch can also be `conceded` by one of players.\nPlayer who conceded match loses it.\nIt can be a technical reason to end match before it goes full length (e.g. one of players cannot proceed because of health state or as result of disqualification).\nReferee then should decide who is the winner.\n\nMore details on match rules can be found [here](https://en.wikipedia.org/wiki/Rules_of_snooker).\n\n## Frame\nFrame is part of match where player should pot balls and got `frame score` to win.\nPlayers tries to pot balls by taking turns at the table.\nIf player pot the ball he should try to pot another one.\nEach potted ball add points to player score.\n__todo: add pot succession rules__\nAmount of points depends on ball colour:\n* Red - 1\n* Yellow - 2\n* Green - 3\n* Brown - 4\n* Blue - 5\n* Pink - 6\n* Black - 7\nFew consecutive successful pots are called `Break`.\nBreak ends when player fails to pot (misses).\nPlayer can earn foul for various things __todo: add foul descriptions__\nEach type of foul adds certain amount of points to opponent of player who conducted foul.\nFrame ends when there are no balls on table or one of player `conceded frame`.\nWhen no balls left on table and score is even black ball returned to table and players play until first foul or pot.\nThis situation is called `respot black`.\nIn certain situations when there are no chance to proceed frame normally players may decide to `rerack frame`.\nBalls are then returned to initial position and frame starts afresh.\n\n## Player performance\nPlayer performance is a set of metrics calculated during each frame:\n* Break sizes;\n* Century and highest breaks;\n* Pot success ratio;\n* Safety shots success ratio;\n* Average and maximum time it took player to make a shot;\nPerformance metrics is calculated for each frame (depending on technical ability to track it).\nPlayer performance may than be aggregated by match, tournament, career e.t.c.\nIt is also possible to sum up performance for tournament or season.\n\n## Turn\nPlayers play frames by taking turns.\nEach turn may result in:\n* Break;\n* Miss;\n* Foul;\n\n# Application use-cases\n\n## Organizing tournament\nLeague manager creates new tournament.\nHe selects tournament type (`small` or `large`).\nTournament grid with all stages is created by system.\n\nLeague manager assigns ranking points for winning each stage as well as ranking points\nfor winning round of qualification.\nHe also sets start and end dates for each stage.\nSystem should check that stage dates does not overlap neither in one tournament nor with other ones.\n\nAfter tournament stages are set-up tournament is announced.\n\n### Tournament start\nAfter previous tournament is ended and ranking is updated, System fills grid of current tournament with players.\nWhen grid is filled tournament becomes ready to start.\n\n#### Adding new tournament before\nLet's assume we have Kyiv Masters scheduled for Jul 15 with previous tournament being Odessa Cup\nended on June 22. After Odessa Cup is ended Kyiv Masters grid is filled with players.\nThen new tournament - Lviv Trophy is added on Jun 30 - Jul 7.\nGrid for Kyiv Masters should be then recalculated after Jul 7 according to ranking after Lviv Trophy.\n\nMinimal time between tournaments is 5 days.\n\n## Denouncing tournament\nTournament can be cancelled at any time before it ends.\nTournament becomes deleted from system and any results are discarded.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimasmith%2Fddd-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimasmith%2Fddd-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimasmith%2Fddd-example/lists"}