Reputation: 279
Is it worth to create a Use Case class when it has only one single dependency and its execution just call a method of that dependency?
public class GetOrdersUseCase {
private OrdersManager ordersManager;
public GetOrderUseCase(OrdersManager ordersManager) {
this.ordersManager = ordersManager;
}
public List<Order> execute() {
ordersManager.getOrders();
}
}
Upvotes: 3
Views: 257
Reputation: 7270
Yes, in order to simplify future maintenance, since one of the main concepts behind the Clean architecture is that there should be a one-to-one mapping between your use case classes and the use cases in the documentation. It makes easier to discover which classes implement what.
Upvotes: 3