Reputation: 19423
I am building an application using WPF, MVVM, and PRISM. the application is an intensive CRUD app, and the db is accessed using entity framework. i want to build the application using modules but i can't figure out where to put the data access code (more accurately i can't figure out where to put the repository interface) . if they go into an infrastructure project. then all modules will depend on that and it doesn't seem like the right place. on the other hand if the interfaces go into their respective modules then there will be lots of inter-dependencies between the modules which is bad.
Question: best way of designing a database-aware modular PRISM MVVM application and perhaps the best solution to my case ?
Upvotes: 0
Views: 1667
Reputation: 4239
I would recommend you to read official Prism guide.
I use this separation:
MyApp
- shell projectMyApp.Infrastructure
- all shared interfaces - including your IRepository
MyApp.DAL
- contains all DAL classes, and also Repository
implementationMyApp.Modules.SimpleModule
MyApp.Modules.AnotherModel
Main thing about modules - they should not depend on each other, but they could depend on shared modules (e.g. MyApp.Infrastructure
).
Upvotes: 1