AbstractEntity has a default toJSON method that results in Entities that must implement a serial data interface that is determined by outer classes of the app thus requiring the entity classes to have knowledge of and be dependent on these outer classes. An improved design will utilize an Adapter class to serialize the entity objects and separate that functionality from the entities to increase the flexibility of the code.
AbstractEntity has a default
toJSON
method that results in Entities that must implement a serial data interface that is determined by outer classes of the app thus requiring the entity classes to have knowledge of and be dependent on these outer classes. An improved design will utilize anAdapter
class to serialize the entity objects and separate that functionality from the entities to increase the flexibility of the code.