C
C#2mo ago
Core

How to structure interfaces and their implementations

Hi, Which project structure is more common? Or is there any other used in practice? 1
ClassLib/
|
|-- Interfaces
| |- IOrder
| | -IPayment
|
|-- Implementations
| |- Order
| |- Payment
ClassLib/
|
|-- Interfaces
| |- IOrder
| | -IPayment
|
|-- Implementations
| |- Order
| |- Payment
2.
ClassLib/
|
|-- Orders
| |- IOrder
| |- Order
|
|-- Payments
| |- IPayment
| |- Payment
ClassLib/
|
|-- Orders
| |- IOrder
| |- Order
|
|-- Payments
| |- IPayment
| |- Payment
4 Replies
Angius
Angius2mo ago
Assuming you even need interfaces there, I prefer the latter
Pobiega
Pobiega2mo ago
Second one is better
Core
Core2mo ago
Thank you, I will migrate to the 2 :)) I had a feeling my choice was not the best How should I name the folder in which I group the interface and implementation? For example: UserRepository and IUserRepository, how should I name the parent folder?
Angius
Angius2mo ago
The former That is what's important about it after all