33import lombok .extern .slf4j .Slf4j ;
44
55/**
6- * Clean Architecture ensures separation of concerns by organizing code,
7- * into layers and making it scalable and maintainable.
6+ * Clean Architecture ensures separation of concerns by organizing code, into layers and making it
7+ * scalable and maintainable.
88 *
9- * <p>In the example there are Entities (Core Models) – Product, Cart,
10- * Order handle business logic.
11- * Use Cases (Application Logic) – ShoppingCartService manages
12- * operations like adding items and checkout.
13- * Interfaces & Adapters – Repositories (CartRepository, OrderRepository)
14- * abstract data handling,
15- * while controllers (CartController, OrderController) manage interactions.
9+ * <p>In the example there are Entities (Core Models) – Product, Cart, Order handle business logic.
10+ * Use Cases (Application Logic) – ShoppingCartService manages operations like adding items and
11+ * checkout. Interfaces & Adapters – Repositories (CartRepository, OrderRepository) abstract data
12+ * handling, while controllers (CartController, OrderController) manage interactions.
1613 */
1714@ Slf4j
1815public final class App {
@@ -31,10 +28,8 @@ public static void main(final String[] args) {
3128 CartRepository cartRepository = new InMemoryCartRepository ();
3229 OrderRepository orderRepository = new InMemoryOrderRepository ();
3330
34- ShoppingCartService
35- shoppingCartUseCase =
36- new ShoppingCartService (
37- productRepository , cartRepository , orderRepository );
31+ ShoppingCartService shoppingCartUseCase =
32+ new ShoppingCartService (productRepository , cartRepository , orderRepository );
3833
3934 CartController cartController = new CartController (shoppingCartUseCase );
4035 OrderController orderController = new OrderController (shoppingCartUseCase );
@@ -46,7 +41,7 @@ public static void main(final String[] args) {
4641 Order order = orderController .checkout (userId );
4742 LOGGER .info ("Total: ${}" + cartController .calculateTotal (userId ));
4843
49- LOGGER .info ("Order placed! Order ID: {}, Total: ${}" ,
50- order .getOrderId (), order .getTotalPrice ());
44+ LOGGER .info (
45+ "Order placed! Order ID: {}, Total: ${}" , order .getOrderId (), order .getTotalPrice ());
5146 }
5247}
0 commit comments