Ibrahim Najjar
Ibrahim Najjar

Reputation: 19423

Building a database-aware application with PRISM

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

Answers (2)

chopikadze
chopikadze

Reputation: 4239

I would recommend you to read official Prism guide.

I use this separation:

  • MyApp - shell project
  • MyApp.Infrastructure - all shared interfaces - including your IRepository
  • MyApp.DAL - contains all DAL classes, and also Repository implementation
  • MyApp.Modules.SimpleModule
  • MyApp.Modules.AnotherModel
  • etc.

Main thing about modules - they should not depend on each other, but they could depend on shared modules (e.g. MyApp.Infrastructure).

Upvotes: 1

Fede
Fede

Reputation: 44038

I think you may take a look at MEF. It allows you to have the level of abstraction and modularity you will need for this while everything working together in a seamless way.

Upvotes: 2

Related Questions