The downsides to creating a new object for each data type are that:
[ul]
[li]You have to create a new object every time you create a DataType (or should at least)[/li]
[li]Unable to use objects to store values for data types not represented with value objects (i.e. Vector2, UDim2, etc)[/li]
[li]Advanced Objects is spammed with lots of value objects since there are so many data types[/li]
[li]API bloat[/li]
[li]No way to check if something is a value object with :IsA(“ValueObject”) since all of them inherit directly from instance – you’d have to do .ClassName == “IntValue” or .ClassName == “NumberValue” or .ClassName" == “Color3Value”… etc.[/li]
[/ul]
If value objects are condensed into a single object with a “Type” property to set the data type it holds, all of those issues are resolved. You’re free to create a value object of any type that exists as soon as a new data type is created instead of hoping that a value object for that data type is eventually added, there will be only one object in the advanced objects window for value objects instead of 10, no need to create even more objects whenever new data types are added, bloating the API, and you’re able to check if something is a value object with .ClassName == “ValueObject”.
IntConstrainedValue and DoubleConstrainedValue should not be condensed into the ValueObject since they’re special and have min and max values that normal object values do not. However, ValueObject, IntConstrainedValue, and DoubleConstrainedValue should all inherit from a superclass “ValueObjects” (better name pls) so that a value object can be discerned with :IsA(“ValueObjects”).