In my C# app I have several libraries. E.g:
- main app EXE
- Helper DLL, A
- Helper DLL, B
- Helper DLL, C
- Data access DLL, D
My data access DLL, D, has an interface it exposes. Helper DLL B exposes another interface that has basically the same properties, but it’s not the same interface (namespace wise and slightly with respect to how those properties are accessed). Furthermore, Helper DLL A uses what B and D expose. This is leading to confusion on my part as I need to connect B & D in A, but I find myself trying to convert between these interfaces and something doesn’t seem right about it.
I’m confused as to what I should do:
- Use the data access interface from D across the whole app or…
- Have each DLL have separate interfaces and convert between them as they cross from one DLL to another.
Is there a preferred solution? If so, why?
If you need all that interfaces, it’s diffcult to say to me just by reading your post, I would, personaly, suggest put them all in DataAccess and also conversion utilities too. So you will have all in one place and any Helper you’ll write in the future will need to refer only that.