mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-05 00:13:33 +00:00
docs: add diagrams for spatial partition, special case, specification, state, step builder, strangler, strategy, subclass sandbox
This commit is contained in:
1 parent
8e823909da
commit
cd224ea5fe
16 files changed
+32
-4
No files matched your search
@@ -37,6 +37,10 @@ In [Patterns of Enterprise Application Architecture](https://amzn.to/3WfKBPR) Ma
|
||||
|
||||
> If you’ll pardon the unresistable pun, I see [Null Object](https://java-design-patterns.com/patterns/null-object/) as special case of Special Case.
|
||||
|
||||
Sequnce diagram
|
||||
|
||||

|
||||
|
||||
## Programmatic Example of Special Case Pattern in Java
|
||||
|
||||
The Special Case Pattern is a software design pattern that is used to handle a specific, often uncommon, case separately from the general case in the code. This pattern is useful when a class has behavior that requires conditional logic based on its state. Instead of cluttering the class with conditional logic, we can encapsulate the special behavior in a subclass.
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 49 KiB |
Reference in new issue
Block a user