Member-only story
Flutter Data Classes, Value Type Objects, And Validation
Note: I have moved my flutter app design writing to my substack which is free to subscribe at:
How DDD Entity, Immutable Value Type Objects, and validation fit together
A lot of GDE’s will show Built Value, Freezed, or Equatable but stop at the other parts of value type objects. Namely, the DDD entity part and the validation part. In this article, we will use some simple Dart OOP to create a value object that uses Equatable to make it an immutable value type and at the same time form a good general purpose validation set of objects for various input types.
Terms To Know
In Domain Driven Design, we have these terms:
-Entities are concern points of complex models and always contain a unique identification field.
-Models contain one or more entities, and usually those entities are value type object fields.In DDD, we have smart models that contain business logic of value object validation in the model.