Where interfaces belong to a tiered application

So, say that you have a three-tier application with level user interfaces, services and a repository for a simple application, say, saving addresses.

If the AddressService has an IAddressService interface, where is this interface located? I know that "in the address service" may seem like the obvious answer, but if it works in the address service, it seems to fail in that the interface will be such that any service library can be replaced as long as it implements IAddressService.

(in particular, this is a problem in the .net taskspace, but probably more general, therefore it is tagged with architecture)

+3
source share
4

.

, , IAddressService

- . ( , ) .

, , - .

+3

, , AddressService.Interfaces AddressService.Contracts, .

+1

/.

, Customers, ICustomerRepository ICustomerAddressRepository ..

.. Customers.Interfaces.ICustomerRepository

0

, . .NET, , , API ahother .

I needed this separation in a Java project in which the applet was supposed to call a web service; therefore, only a bank with interfaces was sent in the browser. If the bank also implemented the implementation, it would be a heavy applet.

0
source

Source: https://habr.com/ru/post/1733954/


All Articles