{"id":32179867,"url":"https://github.com/friemen/domaintypes","last_synced_at":"2025-10-21T22:00:00.895Z","repository":{"id":8481679,"uuid":"10084844","full_name":"friemen/domaintypes","owner":"friemen","description":"Modeling domain data on the basis of Clojure records.","archived":false,"fork":false,"pushed_at":"2014-11-24T20:07:58.000Z","size":192,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-21T22:00:00.725Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","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/friemen.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}},"created_at":"2013-05-15T18:05:43.000Z","updated_at":"2023-05-10T03:55:49.000Z","dependencies_parsed_at":"2022-08-31T22:00:17.113Z","dependency_job_id":null,"html_url":"https://github.com/friemen/domaintypes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/friemen/domaintypes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friemen%2Fdomaintypes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friemen%2Fdomaintypes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friemen%2Fdomaintypes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friemen%2Fdomaintypes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/friemen","download_url":"https://codeload.github.com/friemen/domaintypes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friemen%2Fdomaintypes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280341244,"owners_count":26314177,"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-10-21T02:00:06.614Z","response_time":58,"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":"2025-10-21T21:59:58.705Z","updated_at":"2025-10-21T22:00:00.887Z","avatar_url":"https://github.com/friemen.png","language":"Clojure","funding_links":[],"categories":["Data Validation"],"sub_categories":[],"readme":"domaintypes\n===========\n\nModeling domain data on the basis of Clojure records.\n\n[![Build Status](https://travis-ci.org/friemen/domaintypes.png?branch=master)](https://travis-ci.org/friemen/domaintypes)\n\nMotivation\n----------\nDefault Clojure records are a more formal (and performant) way for describing\nand keeping domain data than pure maps. To model and discuss domain data types\nwith domain experts it is often desirable to attach domain type information\nto fields of records. It is also beneficial to formalize the range\nof admissable values for each field, therefore one should be able to\nattach constraints on different levels of the domain types model.\n\nFinally it would be nice to generate a graphical overview for a domain\ntype model, e.g. a UML class diagram.\n\nThe core project offers functionality to define simple types\n(instances represent scalar values) and\ncomplex types (instances represent structured data).\n\nThe resulting plain Clojure records do not put constraints on the data\nthat one can store in instances. Instead a valid? function checks\non-demand if the data meets the constraints, for instance right before\ndata is persisted in a database, or after deserialization from a\nmessage received from a remote part of the system.\n\n\nProjects\n--------\n - [core](core) provides the macros for defining \n   simple types and complex types, plus some functionality for\n   validation.\n\n - [lein-domaintypesdoc](lein-domaintypesdoc) is a leiningen plugin \n   that generates PlantUML class diagram and PNG image from namespaces containing\n   domain types.\n\n - [samples](samples) contains a demonstration how the macros are used.\n\n\nUsage\n-----\nIn your project.clj add a dependency\n\n    [domaintypes/core \"1.0.1\"]\n\nand a plugin dependency\n\n    [domaintypes/lein-domaintypesdoc \"1.0.1\"]\n\nSpecify additionally with the `:domaintypesdoc-for` key which namespaces should be\nsearched for domain types to be included in a UML class diagram.\nSee the [sample project.clj](samples/project.clj).\n\nA [sample model](samples/src/samples/projectmanagement.clj) would be described like this\n```clojure\n    (defsimpletype required-string \"A non-blank string\" string? #(\u003e (count %) 0))\n    (defsimpletype task-status \"Status of a Task\" #{:new :in-progress :done})\n\n    (defcomplextype Member [name {:dt required-string}])\n\n    (defcomplextype Team [members {:dt Member :card [1 any]}])\n\n    (defcomplextype Task [description {:dt required-string}\n                          status      {:dt task-status}\n                          assignee    {:dt Member :nillable true}])\n\n    (defcomplextype Sprint [name  {:dt required-string}\n                            tasks {:dt Task :card [0 any]}])\n```\n\nA corresponding graphical overview of complex types looks like this\n\n![UML diagram of complextypes](domaintypes.png)\n\nThe image file in the samples/target dir is created by the command\n\n    $ lein domaintypesdoc\n\n\nLicense\n=======\n\nCopyright 2013 F.Riemenschneider\n\nDistributed under the Eclipse Public License, the same as Clojure.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriemen%2Fdomaintypes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffriemen%2Fdomaintypes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriemen%2Fdomaintypes/lists"}