Advantages of abstraction used
ravishivt opened this issue · 0 comments
ravishivt commented
As a new user to this project, the organization of this repo's logic is very convoluted and hard to get a full picture. The README with the code structure helps but isn't enough. It would be helpful to better explain the abstraction choices made to help people understand how it all works together. It would also help to include examples of how to leverage those abstractions since a lot of them appear to be set up but not used in the sample app. Here are a few examples of my uncertainties:
- What is the difference between models.book.Attributes and models.book.RawAttributes? My understanding is they are used for serializing data to be put into the database (raw) and for serializing data coming out of DB (regular)? This would allow you to exclude some data from client responses or include additional data to be put into the DB. Is that accurate? If so, maybe change the two interfaces so there are some differences between the two that would allow the user to infer the purpose.
- There are getters/setters in the model. The setters aren't standard TypeScript set functions though. Why not? Also, all of the getters/setters simply update or read data with no additional logic, i.e. with the samples provided, the user doesn't see any benefit.
- What advantages are there of abstracting Context into its own class?
If there are any articles that explain the advantages of the above abstractions or the choices made to get these abstractions, please share.