I’m currently implementing an application and have for example a Customer model that’s used in several different parts of the application. Each part only uses a subset of the properties from the Customer model. For instance:
- In one place, I use two properties.
- In another place, I use ten properties.
- In yet another place, I use three properties.
I’m unsure whether I should create a different Customer model for each use case or stick with one big Customer model containing all properties.
Creating different models for each scenario seems like it would lead to redundancy and be difficult to maintain, especially when adding new properties. However, using a single large model everywhere might be inefficient and expose unnecessary data.
What are the best practices for managing this in an application? Should I use multiple models or another approach? Any suggestions or examples would be greatly appreciated.
What approach would you recommend to keep the code clean, maintainable, and efficient?
Thank you in advance for your help!