Skip to content

Commit

Permalink
Update task.md
Browse files Browse the repository at this point in the history
language checked
  • Loading branch information
stephen-hero authored and onewhl committed Jan 24, 2024
1 parent e366954 commit a64bba3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions InliningCode/MiddleManCodeSmell/Theory/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ forwarding calls to another class or method **without adding any meaningful beha
Essentially, the Middle Man does not provide any additional value and merely adds unnecessary abstraction,
making the code more complex and harder to understand.

The Inline Method refactoring can help to resolve the Middle Man code smell **by removing the unnecessary methods and
The Inline Method refactoring can help to resolve the Middle Man code smell **by removing unnecessary methods and
directly calling the target methods** from the client classes. By inlining the methods, you eliminate the Middle Man
and reduce the abstraction, leading to cleaner and more straightforward code.
and reduce abstraction, leading to cleaner and more straightforward code.

The **Main.java** file contains an example of the Middle Man code smell.

In this example, the `MiddleMan` class acts as an intermediary by forwarding the call to `DataProvider` to fetch data.
In this example, the `MiddleMan` class acts as an intermediary, forwarding the call to `DataProvider` to fetch data.
However, the `MiddleMan` class does not add any meaningful behavior or value of its own and only complicates the code.
This is a typical example of the Middle Man code smell.

0 comments on commit a64bba3

Please sign in to comment.