Skip to content

Commit 73a5828

Browse files
committed
docs: service locator and service stub diagrams
1 parent b8f3869 commit 73a5828

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

Diff for: service-layer/README.md

-5
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ Architecture diagram
4040

4141
![Service Layer Architecture Diagram](./etc/service-layer-architecture-diagram.png)
4242

43-
4443
## Programmatic Example of Service Layer Pattern in Java
4544

4645
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
358357
INFO [2024-05-27 09:16:40,683] com.iluwatar.servicelayer.app.App: Aderlard Boud has 'Fireball'
359358
```
360359

361-
## Detailed Explanation of Service Layer Pattern with Real-World Examples
362-
363-
![Service Layer](./etc/service-layer.png "Service Layer")
364-
365360
## When to Use the Service Layer Pattern in Java
366361

367362
* Use when you need to separate business logic from presentation logic.

Diff for: service-locator/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ Wikipedia says
3333

3434
> 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.
3535
36+
Sequence diagram
37+
38+
![Service Locator sequence diagram](./etc/service-locator-sequence-diagram.png)
39+
3640
## Programmatic Example of Service Locator Pattern in Java
3741

3842
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.
95.3 KB
Loading

Diff for: service-stub/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ Wikipedia says
3434

3535
> A test stub is a dummy component used during testing to isolate behavior.
3636
37+
Sequence diagram
38+
39+
![Service Stub sequence diagram](./etc/service-stub-sequence-diagram.png)
40+
3741
## Programmatic Example of Service Stub Pattern in Java
3842

3943
We define a `SentimentAnalysisService` interface and provide two implementations:

Diff for: service-stub/etc/service-stub-sequence-diagram.png

53.3 KB
Loading

0 commit comments

Comments
 (0)