I am working on a software stack where it is composed of three different entities:
- abc_data - holding the data as "plain" data structure
- abc_instance - acting as an API
- abc_repo - for internal conversions from abc_data to abc_instance. It includes methods using logic for an easy access and queries of the data (e.g., get_a() or get_b())
When creating a new abc_instance from abc_data, the abc_repo converts the abc_data to a different internal representation for fast access (e.g., vectors, maps) without holding the original abc_data representation anymore. However, this way it is not possible to go back to abc_data from a abc_instance.
What would be the best and elegant way to retrieve the abc_data back from a formerly created abc_instance, ideally without any further conversion.
NOTE: Please understand that I don't want to use de/serialization here. Also keeping a copy of the abc_data is not an option.
Any pointers and help would be appreciated. Thanks in advance!
Aucun commentaire:
Enregistrer un commentaire