I am in charge of design an application (.NET) that has these features:
- It´s a desktop app (maybe in the future will be web-based)
- It´s functionality is to provide users analyzed data retrieved from database. It is done by performing heavy queries generating , graphs and grid-tables to show the information. Users analyze the data to make decisions. The data is stored in relational tables and needs to be treated before being shown. The information is related to statistics, accounting, etc
- Queries are not too much complicated. Multiple Joins with GroupBy,Sum and other calculations will be the worst situation.
- Database will be migrated from Oracle => SQL Server
- The model is related to assembling cars. It stores information about the items that compose a car (price, model, etc). Also stores info about providers, disccounts.
- Domain logic will be able to calculate budgets to some specific cars in one click, perfoming a lot of queries and calculations.
My doubts/questions are:
A) I want to put all the logic inside the code, avoiding the use of stored procedures in the database. I don't like he fact they can not get tested with "generic code" (which will work despite the db engine) and their appearance of being a black-box outputting data. Also i dont want , changes of database engine affects the app too much. I am right? I prefer to have them implemented in LINQ or other approach you think could fit. Do you see some disadvantage on that? Probably memory issues? ( The managed data contains thousands of records with dozens of tables)
B) The queries logic should go in the domain layer. Which will be a good pattern/approach to place them in a scalable way? The number of queries will increase during app maintenance.
C) Do you know a nice approach to unit test the queries in LINQ? Fake data, moqs, etc? Some advice on that?