Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Some extras, common elements may include;
9. Directories follow the correct pattern structure.
10. Each page is built using the [page structure](#page-structure).
11. Custom components should not use a title, they should use the correct heading level in the page itself to ensure proper url based linking.
12. Images need to have padding applied around them, optimally `2rem`.

## Installation

Expand Down
4 changes: 2 additions & 2 deletions docs/structural/bridge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Let's say you have a customer that wants to export the contents of a database to

The customer comes back, they request to also supported `CSV` format for exporting. You create a new class called `CsvExporter` that handles exporting to CSV format. You'll know need to expand this class to handle both settings and friends exporting as well. As you can see, this approach quickly leads to a combinatorial explosion of classes as you add more export formats and data types. Each entity that the customer wants to export requires a new class for each format, leading to a maintenance nightmare.

<div style={{ textAlign: "center" }}>
<div style={{ textAlign: "center", padding: "2rem" }}>
<BridgeProblemSvg />
</div>

Expand All @@ -40,7 +40,7 @@ This is exactly where the **Bridge pattern** comes in. The Bridge pattern sugges

In this structure, instead of having a single `IExporter` interface, we can have an `Exporter` abstraction that defines the export operation. Then, we can have concrete implementations for each export format, such as `JsonExporter` and `CsvExporter`. Each entity to be exported, like `Settings` and `Friends`, can then use an instance of the `Exporter` abstraction to perform the export operation.

<div style={{ textAlign: "center" }}>
<div style={{ textAlign: "center", padding: "2rem" }}>
<BridgeSolutionSvg />
</div>

Expand Down
Loading