I am implementing a library that:
- Takes some input data (I put data structures and classes in the
- Stores the data in a structure (I put data structures and classes in the
- Present the data in some meaningful way (
I divided my code this way because if I want to add another data representation (for example a
table package) I can reuse
I am though worried about circular dependencies:
Parsershould store input data in a dedicated data structure class,
Record, this means that
DataStoragehas to know how to get data from it and that Parser should know how data insertion is performed in
- I am also concerned that the
chart- and eventually
tableas well - package should know a bit more about how to get data from my
Are my concerns valid? If yes, how could I solve the issue?
I was thinking to expose some Interfaces in a
interfaces package in such a way that specific classes such as
DataStorage would implement them and there wouldn't be a circular dependency anymore.
Would this solution be considered a good practice or are there any better alternatives?