I'm building a wpf application which implements the following features:
- Take user input and read data from databases
- perform some calculations on it
- Showcase it to the user in multiple types of views and write changes back to db
Proposed architecture: Database -> Entity Framework -> Repository -> Business Logic -> Data Service -> ViewModel
Reasons to use this architecture: Multiple scenarios present in the application (Multiple views) and multiple databases. Hence, i'm willing to use repository in the middle for abstraction.
One caveat is that the context will be long lived if repository is implemented. To overcome this, is it okay to create a context and dispose them in a using() block in each of the crud methods.?
feel free to suggest alternate approaches.