EricksonLopez.ValueObjects
dotnet-value-objects · Modelado de Dominio
En esta página (20 secciones)
1. Identidad, Nivel y Perfil de Madurez#
2. Propuesta de Valor y Problema que Resuelve#
Zero-allocation, immutable DDD Value Objects and multi-country fiscal satellites for modern .NET with NativeAOT, EF Core, Dapper, and System.Text.Json.
Representar montos monetarios, tasas o identificadores fiscales como decimales y cadenas sueltas provoca mezclas de moneda y validaciones dispersas.
3. Instalación Rápida#
Paquete principal: EricksonLopez.ValueObjects
dotnet add package EricksonLopez.ValueObjects --version 2.0.0<PackageReference Include="EricksonLopez.ValueObjects" Version="2.0.0" /><PackageVersion Include="EricksonLopez.ValueObjects" Version="2.0.0" />4. Métricas Verificadas del Ecosistema#
Instantánea recuperada UTC: 2026-12-01
5. Cuándo Usar y Cuándo NO Usar#
Cuándo usar
- Necesitas Value Objects financieros (Money, CurrencyCode, ExchangeRate, TaxRate), validación con Result y satélites fiscales latinoamericanos.
Cuándo NO usar
- Solo necesitas envoltorios simples de un campo o StrongIds; usa EricksonLopez.DomainPrimitives.
6. Capacidades Principales e Invariantes de Diseño#
Value Objects Financieros y Temporales
Aritmética inmutable de Money en struct con seguridad de moneda, modos de redondeo, BusinessDate, DateRange y Percentage.
Satélites Fiscales Regionales
Paquetes satélite dedicados para identificadores fiscales de República Dominicana, Chile, Colombia, México, Perú y Argentina.
7. Paquetes NuGet y Adaptadores Incluidos#
| ID del Paquete | Estado | NuGet / Local | TFMs | Estado AOT | Descargas | Descripción |
|---|---|---|---|---|---|---|
| EricksonLopez.ValueObjectsPrincipal | Publicado | v2.0.0 / v3.2.0 | netstandard2.0, net8.0, net9.0, net10.0 | AOT: Completo | 597 | Pure domain Value Object infrastructure for high-performance, AOT-first DDD applications in .NET 10+. |
| EricksonLopez.ValueObjects.Fiscal.DominicanRepublic | Publicado | v2.0.0 / v3.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 340 | Domain-Driven Design (DDD) Value Objects and compliance validators for Dominican Republic taxation (DGII, RNC, Cédula, NCF Serie B, e-CF Ley 32-23, Fiscal Periods). |
| EricksonLopez.ValueObjects.Fiscal.Argentina | Publicado | v2.0.0 / v3.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 327 | Domain-Driven Design (DDD) Value Objects and compliance types for Argentine taxation (ARCA/AFIP, CUIT/CUIL Modulo 11, Punto de Venta, CAE/CAEA, CBU/CVU Modulo 10, RG 1415/03, RG 5616/24). |
| EricksonLopez.ValueObjects.Fiscal.Colombia | Publicado | v2.0.0 / v3.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 327 | Domain-Driven Design (DDD) Value Objects and compliance types for Colombian taxation (DIAN, NIT Modulo 11, CUFE, CUDE, CUNE, RADIAN, DANE, CIIU). |
| EricksonLopez.ValueObjects.Fiscal.Peru | Publicado | v2.0.0 / v3.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 316 | Domain-Driven Design (DDD) Value Objects and compliance types for Peruvian taxation (SUNAT, RUC Modulo 11, CPE Identifier Tipo-Serie-Correlativo, SPOT Detracciones, Ubigeo INEI, SIRE TaxPeriod). |
| EricksonLopez.ValueObjects.Fiscal.Chile | Publicado | v2.0.0 / v3.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 315 | Domain-Driven Design (DDD) Value Objects and compliance types for Chilean taxation (SII, RUT Modulo 11 body and check digit 'K', DTEs 33/34/39/41/52/61, Folios, Professional Fee Withholding Law 21.133). |
| EricksonLopez.ValueObjects.Serialization.Json | Publicado | v2.0.0 / v3.2.0 | netstandard2.0, net8.0, net9.0, net10.0 | AOT: Completo | 312 | System.Text.Json Native AOT-compatible serialization adapters for EricksonLopez.ValueObjects. |
| EricksonLopez.ValueObjects.DomainPrimitives | Publicado | v2.0.0 / v3.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 295 | DomainPrimitives bridge and adapter layer for EricksonLopez.ValueObjects. Enables bidirectional conversion and contract compatibility between Value Objects and IDomainPrimitive contracts. |
| EricksonLopez.ValueObjects.Dapper | Publicado | v2.0.0 / v3.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 289 | Dapper TypeHandler adapters for persistence of EricksonLopez.ValueObjects in relational databases like PostgreSQL. |
| EricksonLopez.ValueObjects.EntityFrameworkCore | Publicado | v2.0.0 / v3.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 280 | Entity Framework Core integration for EricksonLopez.ValueObjects. Provides NativeAOT-ready ValueConverters, value comparers, and model configuration conventions for domain Value Objects. |
| EricksonLopez.ValueObjects.Fiscal.Mexico | Publicado | v2.0.0 / v3.2.0 | net8.0, net9.0, net10.0 | AOT: Completo | 280 | Domain-Driven Design (DDD) Value Objects and compliance types for Mexican taxation (SAT, RFC con homoclave, CURP RENAPO, CFDI 4.0 FiscalUuid, Pedimento Aduanal Anexo 22, Carta Porte 3.1 IdCcp, Catálogos SAT). |
| EricksonLopez.ValueObjects.AnalyzersAnalizador / Generador | Publicado | v2.0.0 / v3.2.0 | netstandard2.0 | AOT: N/A (Analizador/Legado) | 293 | Roslyn Analyzers enforcing DDD Value Object invariants, immutability, and safety rules. |
| EricksonLopez.ValueObjects.GeneratorsAnalizador / Generador | Publicado | v2.0.0 / v3.2.0 | netstandard2.0 | AOT: N/A (Analizador/Legado) | 281 | Roslyn Incremental Source Generator for EricksonLopez.ValueObjects boilerplate-free creation. |
| EricksonLopez.ValueObjects.Testing | No publicado | — / v3.2.0 | net8.0, net9.0, net10.0 | AOT: Incompatible | 0 | FsCheck property-based Arbitrary generators for EricksonLopez.ValueObjects and Dominican Republic fiscal primitives (Money, Percentage, RNC Modulo-11, Cédula Luhn). |
8. Ejemplo Quick Start#
Basado en APIs públicas verificadas de EricksonLopez.ValueObjects. Compila con `<ImplicitUsings>disable</ImplicitUsings>` e importaciones explícitas.
using System;
using EricksonLopez.Result;
using EricksonLopez.ValueObjects;
Result<Money> priceResult = Money.Create(199.99m, CurrencyCode.USD);
Result<Money> shippingResult = Money.Create(15.00m, "USD");
if (priceResult.IsSuccess && shippingResult.IsSuccess)
{
Money total = priceResult.Value + shippingResult.Value;
Console.WriteLine($"Total: {total}");
}9. Arquitectura y Flujo de Dependencias#
Renderizando diagrama…
flowchart LR lib_value_objects["EricksonLopez.ValueObjects (L1)"] lib_domain_primitives["EricksonLopez.DomainPrimitives (L0)"] lib_value_objects --> lib_domain_primitives lib_result["EricksonLopez.Result (L0)"] lib_value_objects --> lib_result
Ver descripción textual y tabla accesible
2 dependencias hacia librerías aguas arriba y 0 librerías dependientes aguas abajo verificadas en dependencies.json.
| Dirección | Librería | Nivel | Tipos de Relación |
|---|---|---|---|
| Aguas arriba | EricksonLopez.DomainPrimitives | L0 | Tiempo de compilación, Paquete NuGet |
| Aguas arriba | EricksonLopez.Result | L0 | Tiempo de compilación, Paquete NuGet |
flowchart LR
lib_value_objects["EricksonLopez.ValueObjects (L1)"]
lib_domain_primitives["EricksonLopez.DomainPrimitives (L0)"]
lib_value_objects --> lib_domain_primitives
lib_result["EricksonLopez.Result (L0)"]
lib_value_objects --> lib_result10. Target Frameworks y Matriz Native AOT / Trimming#
Inspección MSBuild `.csproj` sobre 14 paquetes: 11 Full, 0 Partial, 1 Incompatible, 2 NotApplicable (analizadores/generadores).
| ID del Paquete | IsAotCompatible | EnableTrimAnalyzer | Estado AOT Verificado | Target Frameworks |
|---|---|---|---|---|
| EricksonLopez.ValueObjects | true | true | Full | netstandard2.0, net8.0, net9.0, net10.0 |
| EricksonLopez.ValueObjects.Fiscal.DominicanRepublic | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.ValueObjects.Fiscal.Argentina | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.ValueObjects.Fiscal.Colombia | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.ValueObjects.Fiscal.Peru | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.ValueObjects.Fiscal.Chile | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.ValueObjects.Serialization.Json | true | true | Full | netstandard2.0, net8.0, net9.0, net10.0 |
| EricksonLopez.ValueObjects.DomainPrimitives | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.ValueObjects.Dapper | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.ValueObjects.EntityFrameworkCore | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.ValueObjects.Fiscal.Mexico | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.ValueObjects.Analyzers | false | false | NotApplicable | netstandard2.0 |
| EricksonLopez.ValueObjects.Generators | false | false | NotApplicable | netstandard2.0 |
| EricksonLopez.ValueObjects.Testing | false | true | Incompatible | net8.0, net9.0, net10.0 |
11. Dependencias Aguas Arriba y Dependientes Aguas Abajo#
Dependencias Aguas Arriba (2)
Dependientes Aguas Abajo (0)
Ninguna otra librería EricksonLopez.* depende actualmente de esta familia.
12. Adaptadores Opcionales e Integraciones Externas#
Aristas de Adaptadores Internos y Paquetes de Integración
No se registran aristas de adaptadores opcionales ni paquetes de integración para esta librería.
Dependencias NuGet Externas Verificadas (9)
13. Resumen de Configuración y Registro en DI#
Puntos de Entrada DI y Configuración Verificados
JsonSerializerOptionsExtensions.AddValueObjectConvertersRegisters the `ValueObjectJsonConverterFactory` in the specified `JsonSerializerOptions` to ensure that all Value Objects are correctly validated and instantiated via their domain factories during deserialization.
ValueObjectModelConfigurationExtensions.ConfigureDomainValueObjectsRegisters default EF Core value converter mappings for core domain value objects.
Tipos Públicos y Contratos Clave
EricksonLopez.ValueObjects.Address (record)Represents a structured physical address composed of street, city, province, country, and postal code.
EricksonLopez.ValueObjects.Barcode (record)Represents a commercial or industrial barcode supporting GS1 Modulo-10 validated symbologies (GTIN-8, UPC-A / GTIN-12, EAN-13 / GTIN-13, retail variable-weight prefix 20–29, GTIN-14) and alphanumeric Code 128.
EricksonLopez.ValueObjects.BarcodeSymbology (enum)Identifies the detected barcode symbology for a validated `Barcode`.
EricksonLopez.ValueObjects.BatchNumber (record)Represents a manufacturing batch or production lot identifier for traceability. Normalized to uppercase. Rules: Required, 1–80 characters, uppercase alphanumeric with separators (`. _ / -`). Used by: Manufacturing, Quality Control, Inventory, Food & Beverage, Pharmaceuticals.
EricksonLopez.ValueObjects.BusinessDate (record)Represents a calendar date in a business domain without time or time zone components.
EricksonLopez.ValueObjects.Code (record)Represents a generic entity code — an uppercase alphanumeric identifier with separators. Normalized to uppercase. Rules: Required, 1–60 characters, uppercase alphanumeric with `. _ / -` separators (code pattern). Stored uppercase. Used by: ERP, Inventory, POS, SaaS, Property Management, Financial ⚠️ Usage guidance (read before using): `Code` is a deliberately generic VO for domain concepts where the ubiquitous language uses the word "code" without further specificity (e.g., a department code, a category code, a warehouse location code). If your domain concept has a more specific name, prefer a purpose-built VO: - `SKU` — product stock-keeping unit - `TenantCode` — multi-tenant identifier - `DocumentNumber` — numbered document - `ReferenceNumber` — internal reference Using `Code` when a more specific VO exists weakens the Ubiquitous Language. Only use `Code` when the concept genuinely crosses multiple domains with no specific semantic.
EricksonLopez.ValueObjects.Comment (record)Represents a collaborative comment or remark on tasks, tickets, and domain entities. Rules: Required, 1–5,000 characters. Allows standard multiline whitespace (newlines, tabs) while rejecting non-printable control characters. Used by: CRM, Project Management, Issue Tracking, Social Feeds, Approvals.
EricksonLopez.ValueObjects.CompanyName (record)Represents the legal or commercial name of a company, organization, or institution. Rules: Required, 2–180 chars, business name characters (letters, digits, spaces, `& . , ' ( ) / # @ + -`), whitespace collapsed. Used by: ERP, E-Invoicing, CRM, SaaS, Payroll, Property Management, Financial, Donations.
EricksonLopez.ValueObjects.ContactInfo (record)Represents validated corporate or customer contact channels (email, primary/secondary phone, and HTTP/HTTPS website), preventing invalid addresses and dangerous URI schemes (`javascript:`, `data:`, `file:`) from entering domain aggregates.
EricksonLopez.ValueObjects.ContentType (record)Represents a MIME content type (e.g. "application/pdf", "image/png"). Rules: 3–255 chars, lowercase media/subtype format. Used by: Document management, uploads, APIs.
EricksonLopez.ValueObjects.Country (record)Represents an ISO 3166-1 alpha-2 two-letter country code.
EricksonLopez.ValueObjects.CountryCode (record)Represents a validated ISO 3166-1 alpha-2 country code with seamless resolution to ISO alpha-3, numeric-3, and Dominican Republic DGII Formato 609 country codes via `IsoCountry`.
14. Benchmarks de Rendimiento Verificados#
Todas las mediciones verificadas provienen estrictamente de `BenchmarkDotNet.Artifacts` ejecutados sobre .NET RyuJIT (existen 0 ejecuciones NativeAOT en esta instantánea).
| Suite | Método | Runtime | Media (ns) | Asignado (B) | Estado |
|---|---|---|---|---|---|
| ValueObjectBenchmarks | Create_RecordStruct | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 0.001 | 0 | measured |
| ValueObjectBenchmarks | Equals_Struct | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 0.001 | 0 | measured |
| ValueObjectBenchmarks | Create_Struct | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 0.002 | 0 | measured |
| ValueObjectBenchmarks | Equals_RecordStruct | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 0.007 | 0 | measured |
| ValueObjectBenchmarks | Equals_RecordClass | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 0.015 | 0 | measured |
| ValueObjectBenchmarks | Equals_Class | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 0.21 | 0 | measured |
| ValueObjectBenchmarks | Create_Class | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 1.977 | 24 | measured |
| ValueObjectBenchmarks | Create_RecordClass | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 2.056 | 24 | measured |
| ValueObjectBenchmarks | HashCode_RecordStruct | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 10.531 | 0 | measured |
| ValueObjectBenchmarks | HashCode_Struct | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 10.542 | 0 | measured |
| ValueObjectBenchmarks | HashCode_Class | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 11.183 | 0 | measured |
| ValueObjectBenchmarks | DictionaryLookup_RecordStruct | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 12.748 | 0 | measured |
| ValueObjectBenchmarks | HashCode_RecordClass | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 12.912 | 0 | measured |
| ValueObjectBenchmarks | DictionaryLookup_RecordClass | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 14.725 | 0 | measured |
15. Historial de Versiones y Estado NuGet vs Repositorio#
Desfase de versiones detectado: la última versión publicada en NuGet.org es v2.0.0, mientras el HEAD del repositorio local está en v3.2.0.
| Versión | Origen | Fecha de Publicación | Resumen |
|---|---|---|---|
| v2.0.0 ↗ | nuget | 2026-09-21 | Published EricksonLopez.ValueObjects 2.0.0 to NuGet.org. |
| v2.0.0 ↗ | github | 2026-09-21 | Ecosystem Packages in this release | Package | Version | |---------|---------| | `EricksonLopez.ValueObjects` | `2.0.0` | | `EricksonLopez.ValueObjects.Fiscal.DominicanRepublic` | `2.0.0` | | `EricksonLopez.ValueObjects.Fiscal.Chile` | `2.0.0` | | `EricksonLopez.ValueObjects.Fiscal.Colombia` | `2.0.0` | | `EricksonLopez.ValueObjects.Fiscal.Mexico` | `2.0.0` | | `EricksonLopez.ValueObjects.Fisca... |
| v1.0.0 ↗ | github | 2026-08-25 | Ecosystem Packages in this release | Package | Version | |---------|---------| | `EricksonLopez.ValueObjects` | `1.0.0` | | `EricksonLopez.ValueObjects.Fiscal.DominicanRepublic` | `1.0.0` | | `EricksonLopez.ValueObjects.Fiscal.Chile` | `1.0.0` | | `EricksonLopez.ValueObjects.Fiscal.Colombia` | `1.0.0` | | `EricksonLopez.ValueObjects.Fiscal.Mexico` | `1.0.0` | | `EricksonLopez.ValueObjects.Fisca... |
| v1.0.0 ↗ | nuget | 2026-08-25 | Published EricksonLopez.ValueObjects 1.0.0 to NuGet.org. |
16. Librerías Complementarias y Relacionadas#
Librerías en el mismo nivel, capa arquitectónica o vinculadas directamente mediante aristas de dependencia.
17. Documentación, API Reference y Enlaces del Portal#
Documentación Conceptual (Starlight) →
Referencia de API XML Extraída →
18 namespaces · 220 tipos · 1909 miembros
Mapa de Dependencias del Ecosistema →
Centro de Aprendizaje y Manual →
Las páginas conceptuales por librería en Starlight se completan en M4; las páginas de API Reference en M3.2.
18. Repositorio Fuente, Licencia y Contribución#
Publicado bajo Licencia MIT. Todos los ensamblados cumplen los invariantes de compilación EricksonLopez.*: importaciones explícitas, firma fuerte (`EricksonLopez.snk`) y metadatos de autor en ASCII (`Erickson Lopez`).
19. Resolución de Problemas, Riesgos y Migración#
- Usa Money.Create(...) y valida Result.IsFailure en lugar de default(Money); los analizadores ELVO previenen structs sin inicializar.
- Desfase de versiones detectado: la última versión publicada en NuGet.org es v2.0.0, mientras el HEAD del repositorio local está en v3.2.0.
20. Evidencia de Calidad y Verificación#
- Firma Fuerte (`EricksonLopez.snk`)
- EricksonLopez.snk
- `ImplicitUsings=disable`
- disable
- Extracción de Documentación XML
- Verificado (18 namespaces, 220 tipos, 1909 miembros)
- Atributos MSBuild AOT / Trimming
- 11 Full / 0 Partial / 1 Incompatible / 2 N/A
- Artefactos BenchmarkDotNet
- 16 total (14 measured, 2 na_error)
Límites Explícitos de Verificación y Alcance
- Todas las mediciones verificadas provienen estrictamente de `BenchmarkDotNet.Artifacts` ejecutados sobre .NET RyuJIT (existen 0 ejecuciones NativeAOT en esta instantánea).
- 1 no publicados