A collection of commonly used VALue OBjectS in enterprise applications
In Domain-Driven Design (DDD), a Value Object is one of the building blocks used to model the domain. Value Objects are objects whose equality is determined by the value of their attributes rather than by their identity. In other words, two Value Objects are considered equal if they have the same set of attribute values, even if they are distinct instances.
Here are some key characteristics and considerations for Value Objects in DDD:
-
Immutability: Value Objects are typically immutable, meaning their state cannot be changed once they are created. This immutability ensures that the value of a Value Object remains constant throughout its lifetime.
-
Equality: Equality of Value Objects is based on the equality of their attributes. If two Value Objects have the same attribute values, they are considered equal, regardless of their individual identity.
-
Identity Ignored: Unlike entities, which have a distinct identity, Value Objects do not have a conceptual identity. They are defined only by their attributes. This means that if you create a new Value Object with the same attribute values as an existing one, they are considered equal.
-
Side-Effect-Free: Value Objects should not have any side effects. Operations on Value Objects should not change the state of the system or other objects.
-
Examples: Common examples of Value Objects include simple types such as strings, numbers, and dates, as well as more complex structures like Money, Address, or PhoneNumber. These objects are characterized by the fact that their identity is determined by their attribute values.
Using Value Objects in your domain model helps to clarify the semantics of the model and can lead to more expressive and intention-revealing code. They are particularly useful for modeling concepts in your domain that are defined by their attributes rather than their identity.
In enterprise applications, there are many common concepts that are represented as Value Objects. These concepts often have well-defined attributes and behaviors, and are used across different domains and applications. Examples include dates, times, money, addresses, and phone numbers.
VALOBS is a collection of commonly used Value Objects that can be used as building blocks in your domain model. By using these pre-defined Value Objects, you can avoid reinventing the wheel and ensure consistency and correctness in your domain model. You can also take advantage of the best practices and patterns that are built into these Value Objects.
No, it won't.
The list of Value Objects in VALOBS is not exhaustive, and it is not intended to cover every possible Value Object that you might encounter in your domain. Instead, it focuses on the most common and widely used Value Objects that are applicable to a wide range of domains and applications.
- Integer
- Decimal
- Percentage
- Ratio
- CurrencyAmount
- MeasurementUnit
- Fraction
- Date
- Time
- DateTime
- Duration
- TimeInterval
- Timezone
- Latitude
- Longitude
- GeoLocation
- Address
- Country
- Continent
- EmailAddress
- PhoneNumber
- URL
- SocialMediaHandle
- PostalAddress
- UUID
- GUID
- SerialNumber
- NationalID
- PassportNumber
- EmployeeID
- Length
- Weight
- Volume
- Area
- Temperature
- Speed
- Name
- Description
- Title
- Comment
- TextContent
- Tag
- Money
- CurrencyExchangeRate
- CreditCard
- PaymentTransaction
- Invoice
- FinancialAmount
- StatusCode
- ConfigurationParameter
- FeatureToggle
- CodeSnippet
- VersionNumber
- APIKey
- Password
- HashValue
- EncryptionKey
- DigitalSignature
- OAuthToken
- APIAccessToken
- File
- Image
- Video
- Audio
- Document
- FileFormat
- ProfileID
- ConnectionRequest
- RelationshipStatus
- Notification
- GroupID
- ChatMessage
- HeartRate
- BloodPressure
- CaloricIntake
- StepsCount
- BMI
- SleepDuration
- ScientificNotation
- AtomicNumber
- MolecularWeight
- pHValue
- Gravity
- StudentID
- CourseCode
- Grade
- EducationalInstitution
- Transcript
- ExamScore
- VehicleIdentificationNumber (VIN)
- LicensePlate
- Route
- FlightNumber
- TicketNumber
- FuelConsumption
- CarbonFootprint
- PollutionIndex
- RenewableEnergyProduction
- EnvironmentalImpact
- ContractID
- ComplianceStatus
- LegalCaseNumber
- RegulatoryApproval
- LicenseNumber
- CustomCode
- UniqueIdentifier
- BusinessID
- EntityCode
- ReferenceNumber
- Barcode
- Color
- ISBN
- DomainName
- Language
- DeviceID
- Speed (e.g., meters per second)
- Acceleration
- Voltage
- Current
- Resistance
- Frequency
- FiscalYear
- AcademicTerm
- BookingPeriod
- ProjectTimeline
- Season
- EpochTime
- State
- Province
- City
- District
- Neighborhood
- Landmark
- CommunicationProtocol
- MessagingQueue
- ChatRoom
- VoIPCallID
- BroadcastChannel
- BiometricData
- FacialRecognitionData
- VoicePrint
- Fingerprint
- RetinaScan
- PrecisionLevel
- Tolerance
- MarginOfError
- Sensitivity
- CalibrationValue
- FontStyle
- TextAlignment
- MarkupLanguage
- WritingStyle
- LanguageVariant
- TransactionID
- BankingTransactionType
- InvestmentPortfolio
- TaxID
- PayoutAmount
- ConfigurationKey
- EnvironmentVariable
- FeatureFlagStatus
- DebugMode
- LogLevel
- AccessControlList (ACL)
- PermissionSet
- SecurityClearanceLevel
- BiometricAccessLevel
- SecureToken
- MetadataTag
- ExifData
- CopyrightInformation
- DigitalAssetID
- MediaResolution
- SocialEventID
- AttendeeList
- SocialInteractionType
- SocialGroupID
- EventLocation
- CholesterolLevel
- BloodSugarLevel
- FitnessGoal
- HealthInsurancePolicy
- MedicalHistory
- PlanckConstant
- AvogadroNumber
- GravitationalConstant
- SpeedOfLight
- BoltzmannConstant
- DiplomaID
- Certification
- DegreeType
- AcademicAward
- GraduationStatus
- TrafficCondition
- NavigationRoute
- RouteOptimization
- TransportationMode
- ParkingSpotID
- EcologicalFootprint
- BiodiversityIndex
- EnvironmentalPolicy
- ConservationAreaID
- LegalDocumentID
- LegalCaseStatus
- CourtOrder
- LegalRepresentation
- NotarizationRecord
- CustomIdentifier
- EntityAlias
- ReferenceCode
- ClientID
- VendorCode
- AugmentedRealityMarker
- VirtualRealityEnvironment
- SubscriptionPlan
- TradeOrderID
- UniqueDeviceIdentifier (UDID)