Interface Best Practices

I am working on an application that breaks down as follows (simplified)

App
|
Framework
|
Data (Persistance)
|
Data.Couchbase

Inside the App, we configure the DI container and register which specific implementations will be used when a specific interface is needed.

those. The IUserRepository in the Data namespace will be executed by CouchbaseUserRepository in the Data.Couchbase namespace. In the future, if we replace the resistance layer with another technology, say Mongo, we can update the DI registration, and this will be done, say, MongoUserRepository

All is well and good ....

Question 1

, , Data.Couchbase. ICouchbaseUserRepository, ? , IUserRepository → CouchbaseUserRepository, ? Similary - , , ,

2

Framework, - - Data, Framework Data. ... , , ..... , , "",

+5
2

1

CouchbaseUserRepository, IUserRepository, . , , Mongo, MongoUserRepositor .

2

, : db . , . .

+1

. , Programmers. (https://softwareengineering.stackexchange.com/)

, - , , .

( ) - , .

, /, . . . . , DB.

, , - , .

+1

All Articles