diff --git a/service-layer/README.md b/service-layer/README.md index 1d737980e..f2dc54115 100644 --- a/service-layer/README.md +++ b/service-layer/README.md @@ -40,7 +40,6 @@ Architecture diagram ![Service Layer Architecture Diagram](./etc/service-layer-architecture-diagram.png) - ## Programmatic Example of Service Layer Pattern in Java Our Java implementation uses the Service Layer pattern to streamline interactions between data access objects (DAOs) and the business logic, ensuring a clean separation of concerns. @@ -358,10 +357,6 @@ INFO [2024-05-27 09:16:40,681] com.iluwatar.servicelayer.app.App: Find wizards INFO [2024-05-27 09:16:40,683] com.iluwatar.servicelayer.app.App: Aderlard Boud has 'Fireball' ``` -## Detailed Explanation of Service Layer Pattern with Real-World Examples - -![Service Layer](./etc/service-layer.png "Service Layer") - ## When to Use the Service Layer Pattern in Java * Use when you need to separate business logic from presentation logic. diff --git a/service-locator/README.md b/service-locator/README.md index 68c803e70..7e8e25d10 100644 --- a/service-locator/README.md +++ b/service-locator/README.md @@ -33,6 +33,10 @@ Wikipedia says > The service locator pattern is a design pattern used in software development to encapsulate the processes involved in obtaining a service with a strong abstraction layer. This pattern uses a central registry known as the "service locator", which on request returns the information necessary to perform a certain task. Proponents of the pattern say the approach simplifies component-based applications where all dependencies are cleanly listed at the beginning of the whole application design, consequently making traditional dependency injection a more complex way of connecting objects. Critics of the pattern argue that it is an antipattern which obscures dependencies and makes software harder to test. +Sequence diagram + +![Service Locator sequence diagram](./etc/service-locator-sequence-diagram.png) + ## Programmatic Example of Service Locator Pattern in Java The Service Locator design pattern is used to abstract the processes involved in obtaining a service. It uses a central registry, the "service locator", which returns the necessary information to perform a task upon request. This Java design pattern is particularly useful in enterprise Java applications where services need centralized management. diff --git a/service-locator/etc/service-locator-sequence-diagram.png b/service-locator/etc/service-locator-sequence-diagram.png new file mode 100644 index 000000000..3987b0392 Binary files /dev/null and b/service-locator/etc/service-locator-sequence-diagram.png differ diff --git a/service-stub/README.md b/service-stub/README.md index 4058b9625..73b0be059 100644 --- a/service-stub/README.md +++ b/service-stub/README.md @@ -34,6 +34,10 @@ Wikipedia says > A test stub is a dummy component used during testing to isolate behavior. +Sequence diagram + +![Service Stub sequence diagram](./etc/service-stub-sequence-diagram.png) + ## Programmatic Example of Service Stub Pattern in Java We define a `SentimentAnalysisService` interface and provide two implementations: diff --git a/service-stub/etc/service-stub-sequence-diagram.png b/service-stub/etc/service-stub-sequence-diagram.png new file mode 100644 index 000000000..de83741a5 Binary files /dev/null and b/service-stub/etc/service-stub-sequence-diagram.png differ