user1263981
user1263981

Reputation: 3147

Web API Business Layer Architecture and its responsibilities

I have following classes in my web api business layer, i was wondering if GatewayService class should be in Business layer or should i put that in separate project called BusinessService? because its not being directly called in controller class and it doesn't depend on data repository ?

Business Layer

Here is what Transaction Controller doing;

Transaction Controller

Getting a list of users from < UserService >

Passing a list of Users to < TransactionService > which will then return a list of user transactions

Passing a list of all transactions to < TransactionService > to process them through a data repository class

Upvotes: 3

Views: 3573

Answers (2)

user6854635
user6854635

Reputation:

It would be a part of the business layer. The business layer is where you would implement the external requirements for your system fx. logistics and so. Which falls under the same category as your gateway service.

Upvotes: 0

Sebastian 506563
Sebastian 506563

Reputation: 7228

In case of N-Layer architecture

TransactionService should be in an Application layer, then your GatewayService can be part of the Business Layer.

enter image description here

In case of Clean Architecture

GatewayService should be part of Presistence or Infrastracture layer so it is not a business layer (here domain and application).

enter image description here

Upvotes: 1

Related Questions