benedekh / WeLoveClouds

Repository for submissions on the CloudDB course.
0 stars 1 forks source link

Serialization Architechture issue #167

Closed banctilrobitaille closed 7 years ago

banctilrobitaille commented 7 years ago

The object being serialized has a dependency on its subparts serializer. For example: RingMetadata.class has a dependency on RingMetadataPartSerializer.class which is bad, also it violates the Single Responsibility Principle because the RingMetadata models now act as a serializer for itself. RingMetadadataSerializer should contain and use the RingMetadataPartsSerializer.

banctilrobitaille commented 7 years ago

The ISerializer are composite (they contain ISerializer and implement ISerializer), and each ISerializer only depends on the object they should serialize.

image

banctilrobitaille commented 7 years ago

This is the old arcchcitechture as it is now, there are so many unwanted dependencies. The worst part is that the models cant live without the serializer. This should never happen. Example: If we delete the ISerializerInterface all the models can't build, a model should be able to live by itself as it's just data reprensentation.

image