Jaguar-dart / jaguar_serializer

Format (JSON, XML, protobuf, mongodb, etc) and platform (server, client) agnostic serialization framework
172 stars 34 forks source link

Immutable list #184

Open jaumard opened 4 years ago

jaumard commented 4 years ago

When deserialization is done and model contains list, they should be immutable (meaning use growable:false) to prevent miss usage add allow add/remove items into those list.

keshava19 commented 4 years ago

What about the cases when you want to work on top of the list ?

jaumard commented 4 years ago

If models are annotated with @immutable it means we want immutable models so everything should be immutable not only final fields. People who doesn't want immutable would be able to work on top of the list like this. Or you can still create a list from the immutable one if you want to