{"id":24604079,"url":"https://github.com/digillect/ddd-identifiers","last_synced_at":"2026-06-22T01:31:14.479Z","repository":{"id":273894294,"uuid":"921221729","full_name":"Digillect/ddd-identifiers","owner":"Digillect","description":"Framework to create source generators for value-object identifiers","archived":false,"fork":false,"pushed_at":"2025-12-09T10:52:03.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-08T03:10:55.862Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"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/Digillect.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-23T15:11:45.000Z","updated_at":"2025-12-09T10:52:07.000Z","dependencies_parsed_at":"2025-01-23T16:30:59.666Z","dependency_job_id":"4186ade2-37ce-4f09-83a5-dd858139d532","html_url":"https://github.com/Digillect/ddd-identifiers","commit_stats":null,"previous_names":["digillect/ddd-identifiers"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Digillect/ddd-identifiers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Digillect%2Fddd-identifiers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Digillect%2Fddd-identifiers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Digillect%2Fddd-identifiers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Digillect%2Fddd-identifiers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Digillect","download_url":"https://codeload.github.com/Digillect/ddd-identifiers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Digillect%2Fddd-identifiers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34630770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"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-01-24T15:17:03.825Z","updated_at":"2026-06-22T01:31:14.456Z","avatar_url":"https://github.com/Digillect.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Digillect DDD Identifiers\n\nExtensible framework to build source generators that create value-object-based identifiers, accompanied by the\npre-made all-purpose source generator.\n\n## Why?\n\n**Value-object identifiers** prioritize clear, stable representations of entities, enabling developers to focus \non the unique identity of objects rather than potentially mutable or overloaded values. This approach mitigates\nrisks of misrepresentation, improves maintainability, and enhances the semantic precision of the codebase.\n\n#### **Why Not Value Obsession?**\n1. **Ambiguity**: Over-reliance on raw values can lead to ambiguity. For example, using `12345` as both an account number and a transaction ID can cause confusion.\n2. **Mutability**: If values change (e.g., due to normalization or formatting), code dependent on these raw values may break.\n3. **Lack of Context**: Values alone lack the context needed to distinguish their role, which can result in bugs or misinterpretation.\n\n#### **Why Value-Object Identifiers?**\n1. **Strong Typing**: Encapsulating identifiers in value objects enforces a strict type system. For example, `AccountNumber` and `TransactionId` are distinct types, reducing the likelihood of accidental misuse.\n2. **Immutability**: Value-object identifiers are typically immutable, ensuring their stability and reliability as references.\n3. **Enhanced Readability**: Using descriptive value objects makes the code self-documenting. Instead of `string` or `int`, a developer sees `CustomerId` or `ProductSku`, clarifying intent.\n4. **Domain Modeling**: Value objects align with Domain-Driven Design principles by representing concepts in the domain explicitly and unambiguously.\n\nBy transitioning to value-object identifiers, developers create a codebase that is more **resilient to change**, \neasier to understand, and less prone to errors, especially in complex systems with interrelated entities.\n\n\n## Usage\n\n### As a ready-to-use source generator\n\nIf the value types of your identifiers are limited to `int`, `string` or `Guid`, you can use the \n`Digillect.DDD.Identifiers.SourceGenerator` by referencing that package (and `Digillect.DDD.Identifiers` as well) from\nyour project. Then declare public readonly partial structs and decorate them with the\n`Digillect.DDD.Identifiers.IdentifierAttribute\u003cT\u003e`, where `T` is one of `int`, `string` or `Guid`.\n\n```csharp\nusing Digillect.DDD.Identifiers;\n\n[Identifier\u003cint\u003e]\npublic readonly partial struct IntegerBasedIdentifier;\n\n[Identifier\u003cstring\u003e]\npublic readonly partial struct StringBasedIdentifier;\n\n[Identifier\u003cGuid\u003e]\npublic readonly partial struct GuidBasedIdentifier;\n```\n\n### As a slightly tuned custom generator\n\nUse [Example generator](https://github.com/Digillect/ddd-identifiers/blob/main/example/ExampleGenerator/ExampleGenerator.csproj)\nas a reference to learn how to modify source generator configuration.\n\nPlease note that you have to modify the project file of your source generator's project to\nsimplify its consumption.\n\n### As a custom source generator with your own logic\n\n[TBD]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigillect%2Fddd-identifiers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigillect%2Fddd-identifiers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigillect%2Fddd-identifiers/lists"}