LVClass Serializer would be better implemented as an interface
Issue #120
new
I know it would lock you in to 2020+, but I think changing “LVClass Serializer” to an interface instead of a class would actually be very beneficial. The immediate benefit I saw was that it would allow my class to “deserialize itself” and thus be able to deserialize private data without any kind of accessors required. Without going too deeply in to the though process, I think you may also get a usability benefit to the API such that you could remove the need for the LVClass Serializer input altogether, and it would be sufficient for the user to just pass in the class they care about by itself.
Comments (3)
-
repo owner -
reporter Yeah, that’s what I was thinking. Out of curiosity, do you have a timeline for going to 2020?
-
repo owner No timeline, but maybe another year or two.
- Log in to comment
The plan, when in 2020, is to have a defined interface with “To JSON” and “From JSON” methods, so a class can handle its own conversion. This is different, though, than the “serializer” input, as that is a way to inject a method to serialize any class.