Skip to content

Commit 6cd2d03

Browse files
authored
docs: Content SEO updates (iluwatar#2990)
* update yaml frontmatter format * update abstract document * update abstract factory * use the new pattern template * acyclic visitor seo * adapter seo * ambassador seo * acl seo * aaa seo * async method invocation seo * balking seo * bridge seo * builder seo * business delegate and bytecode seo * caching seo * callback seo * chain seo * update headings * circuit breaker seo * client session + collecting parameter seo * collection pipeline seo * combinator SEO * command seo * cqrs seo * commander seo * component seo * composite seo * composite entity seo * composite view seo * context object seo * converter seo * crtp seo * currying seo * dao seo * data bus seo * data locality seo * data mapper seo * dto seo * decorator seo * delegation seo * di seo * dirty flag seo * domain model seo * double buffer seo * double checked locking seo * double dispatch seo * dynamic proxy seo * event aggregator seo * event-based asynchronous seo * eda seo * event queue seo * event sourcing seo * execute around seo * extension objects seo * facade seo * factory seo * factory kit seo * factory method seo * fanout/fanin seo * feature toggle seo * filterer seo * fluent interface seo * flux seo * flyweight seo * front controller seo * function composition seo * game loop seo * gateway seo * guarded suspension seo * half-sync/half-async seo * health check seo * hexagonal seo * identity map seo * intercepting filter seo * interpreter seo * iterator seo * layers seo * lazy loading seo * leader election seo * leader/followers seo * lockable object seo * rename and add seo for marker interface * master-worker seo * mediator seo * memento seo * metadata mapping seo * microservice aggregator seo * api gw seo * microservices log aggregration seo * mvc seo * mvi seo * mvp seo * mvvm seo * monad seo * monitor seo * monostate seo * multiton seo * mute idiom seo * naked objects & notification seo * null object seo * object mother seo * object pool seo * observer seo * optimistic locking seo * page controller seo * page object seo * parameter object seo * partial response seo * pipeline seo * poison pill seo * presentation model seo * private class data seo * producer-consumer seo * promise seo * property seo * prototype seo * proxy seo * queue-based load leveling seo * reactor seo * registry seo * repository seo * RAII seo * retry seo * role object seo * saga seo * separated interface seo * serialized entity seo * serialized lob seo * servant seo * server session seo * service layer seo * service locator seo * service to worker seo * sharding seo * single table inheritance seo * singleton seo * spatial partition seo * special case seo * specification seo * state seo * step builder seo * strangler seo * strategy seo * subclass sandbox seo * table module seo * template method seo * throttling seo * tolerant reader seo * trampoline seo * transaction script seo * twin seo * type object seo * unit of work seo * update method seo * value object seo * version number seo * virtual proxy seo * visitor seo * seo enhancements * seo improvements * SEO enhancements * SEO improvements * SEO additions * SEO improvements * more SEO improvements * rename hexagonal + SEO improvements * SEO improvements * more SEO stuff * SEO improvements * SEO optimizations * SEO enhancements * enchance SEO * improve SEO * SEO improvements * update headers
1 parent cb946c0 commit 6cd2d03

File tree

219 files changed

+3308
-2819
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+3308
-2819
lines changed

abstract-document/README.md

+20-18
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
---
2-
title: Abstract Document
2+
title: "Abstract Document Pattern in Java: Simplifying Data Handling with Flexibility"
3+
shortTitle: Abstract Document
4+
description: "Explore the Abstract Document design pattern in Java. Learn its intent, explanation, applicability, benefits, and see real-world examples to implement flexible and dynamic data structures."
35
category: Structural
46
language: en
57
tag:
6-
- Abstraction
7-
- Decoupling
8-
- Dynamic typing
9-
- Encapsulation
10-
- Extensibility
11-
- Polymorphism
8+
- Abstraction
9+
- Decoupling
10+
- Dynamic typing
11+
- Encapsulation
12+
- Extensibility
13+
- Polymorphism
1214
---
1315

14-
## Intent
16+
## Intent of Abstract Document Design Pattern
1517

16-
The Abstract Document design pattern is a structural design pattern that aims to provide a consistent way to handle hierarchical and tree-like data structures by defining a common interface for various document types. It separates the core document structure from specific data formats, enabling dynamic updates and simplified maintenance.
18+
The Abstract Document design pattern in Java is a crucial structural design pattern that provides a consistent way to handle hierarchical and tree-like data structures by defining a common interface for various document types. It separates the core document structure from specific data formats, enabling dynamic updates and simplified maintenance.
1719

18-
## Explanation
20+
## Detailed Explanation of Abstract Document Pattern with Real-World Examples
1921

20-
The Abstract Document pattern enables handling additional, non-static properties. This pattern uses concept of traits to enable type safety and separate properties of different classes into set of interfaces.
22+
The Abstract Document design pattern in Java allows dynamic handling of non-static properties. This pattern uses concept of traits to enable type safety and separate properties of different classes into set of interfaces.
2123

2224
Real-world example
2325

24-
> Imagine a library system where books can have different formats and attributes: physical books, eBooks, and audiobooks. Each format has unique properties, such as page count for physical books, file size for eBooks, and duration for audiobooks. The Abstract Document design pattern allows the library system to manage these diverse formats flexibly. By using this pattern, the system can store and retrieve properties dynamically, without needing a rigid structure for each book type, making it easier to add new formats or attributes in the future without significant changes to the codebase.
26+
> Consider a library system implementing the Abstract Document design pattern in Java, where books can have diverse formats and attributes: physical books, eBooks, and audiobooks. Each format has unique properties, such as page count for physical books, file size for eBooks, and duration for audiobooks. The Abstract Document design pattern allows the library system to manage these diverse formats flexibly. By using this pattern, the system can store and retrieve properties dynamically, without needing a rigid structure for each book type, making it easier to add new formats or attributes in the future without significant changes to the codebase.
2527
2628
In plain words
2729

@@ -31,7 +33,7 @@ Wikipedia says
3133

3234
> An object-oriented structural design pattern for organizing objects in loosely typed key-value stores and exposing the data using typed views. The purpose of the pattern is to achieve a high degree of flexibility between components in a strongly typed language where new properties can be added to the object-tree on the fly, without losing the support of type-safety. The pattern makes use of traits to separate different properties of a class into different interfaces.
3335
34-
**Programmatic Example**
36+
## Programmatic Example of Abstract Document Pattern in Java
3537

3638
Consider a car that consists of multiple parts. However, we don't know if the specific car really has all the parts, or just some of them. Our cars are dynamic and extremely flexible.
3739

@@ -177,13 +179,13 @@ The program output:
177179
07:21:57.395 [main] INFO com.iluwatar.abstractdocument.App -- door/Lambo/300
178180
```
179181
180-
## Class diagram
182+
## Abstract Document Pattern Class Diagram
181183
182184
![Abstract Document](./etc/abstract-document.png "Abstract Document Traits and Domain")
183185
184-
## Applicability
186+
## When to Use the Abstract Document Pattern in Java
185187
186-
This pattern is particularly useful in scenarios where you have different types of documents that share some common attributes or behaviors, but also have unique attributes or behaviors specific to their individual types. Here are some scenarios where the Abstract Document design pattern can be applicable:
188+
The Abstract Document design pattern is especially beneficial in scenarios requiring management of different document types in Java that share some common attributes or behaviors, but also have unique attributes or behaviors specific to their individual types. Here are some scenarios where the Abstract Document design pattern can be applicable:
187189
188190
* Content Management Systems (CMS): In a CMS, you might have various types of content such as articles, images, videos, etc. Each type of content could have shared attributes like creation date, author, and tags, while also having specific attributes like image dimensions for images or video duration for videos.
189191
@@ -209,7 +211,7 @@ This pattern is particularly useful in scenarios where you have different types
209211

210212
The key idea behind the Abstract Document design pattern is to provide a flexible and extensible way to manage different types of documents or entities with shared and distinct attributes. By defining a common interface and implementing it across various document types, you can achieve a more organized and consistent approach to handling complex data structures.
211213

212-
## Consequences
214+
## Benefits and Trade-offs of Abstract Document Pattern
213215

214216
Benefits:
215217

@@ -227,7 +229,7 @@ Trade-offs:
227229

228230
* Performance: Might introduce slight performance overhead compared to direct data access.
229231

230-
## Credits
232+
## References and Credits
231233

232234
* [Design Patterns: Elements of Reusable Object-Oriented Software](https://amzn.to/3w0pvKI)
233235
* [Java Design Patterns: A Hands-On Experience with Real-World Examples](https://amzn.to/3yhh525)

abstract-factory/README.md

+22-20
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
---
2-
title: Abstract Factory
2+
title: "Abstract Factory Pattern in Java: Mastering Object Creation Elegantly"
3+
shortTitle: Abstract Factory
4+
description: "Learn the Abstract Factory pattern in Java with real-world examples, class diagrams, and tutorials. Understand its intent, applicability, benefits, and known uses to enhance your design pattern knowledge."
35
category: Creational
46
language: en
57
tag:
6-
- Abstraction
7-
- Decoupling
8-
- Gang of Four
9-
- Instantiation
10-
- Polymorphism
8+
- Abstraction
9+
- Decoupling
10+
- Gang of Four
11+
- Instantiation
12+
- Polymorphism
1113
---
1214

1315
## Also known as
1416

1517
* Kit
1618

17-
## Intent
19+
## Intent of Abstract Factory Design Pattern
1820

19-
Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
21+
The Abstract Factory pattern in Java provides an interface for creating families of related or dependent objects without specifying their concrete classes, enhancing modularity and flexibility in software design.
2022

21-
## Explanation
23+
## Detailed Explanation of Abstract Factory Pattern with Real-World Examples
2224

2325
Real-world example
2426

25-
> Imagine a furniture company that produces various styles of furniture: modern, Victorian, and rustic. Each style includes products like chairs, tables, and sofas. To ensure consistency within each style, the company uses an Abstract Factory pattern.
27+
> Imagine a furniture company that uses the Abstract Factory pattern in Java to produce various styles of furniture: modern, Victorian, and rustic. Each style includes products like chairs, tables, and sofas. To ensure consistency within each style, the company uses an Abstract Factory pattern.
2628
>
2729
> In this scenario, the Abstract Factory is an interface for creating families of related furniture objects (chairs, tables, sofas). Each concrete factory (ModernFurnitureFactory, VictorianFurnitureFactory, RusticFurnitureFactory) implements the Abstract Factory interface and creates a set of products that match the specific style. This way, clients can create a whole set of modern or Victorian furniture without worrying about the details of their instantiation. This maintains a consistent style and allows easy swapping of one style of furniture for another.
2830
@@ -34,9 +36,9 @@ Wikipedia says
3436

3537
> The abstract factory pattern provides a way to encapsulate a group of individual factories that have a common theme without specifying their concrete classes
3638
37-
**Programmatic Example**
39+
## Programmatic Example of Abstract Factory in Java
3840

39-
To create a kingdom we need objects with a common theme. The elven kingdom needs an elven king, elven castle, and elven army whereas the orcish kingdom needs an orcish king, orcish castle, and orcish army. There is a dependency between the objects in the kingdom.
41+
To create a kingdom using the Abstract Factory pattern in Java, we need objects with a common theme. The elven kingdom needs an elven king, elven castle, and elven army whereas the orcish kingdom needs an orcish king, orcish castle, and orcish army. There is a dependency between the objects in the kingdom.
4042

4143
Translating the kingdom example above. First of all, we have some interfaces and implementation for the objects in the kingdom.
4244

@@ -163,13 +165,13 @@ The program output:
163165
07:35:46.343 [main] INFO com.iluwatar.abstractfactory.App -- This is the orc king!
164166
```
165167

166-
## Class diagram
168+
## Abstract Factory Pattern Class Diagram
167169

168170
![Abstract Factory](./etc/abstract-factory.urm.png "Abstract Factory class diagram")
169171

170-
## Applicability
172+
## When to Use the Abstract Factory Pattern in Java
171173

172-
Use the Abstract Factory pattern when:
174+
Use the Abstract Factory pattern in Java when:
173175

174176
* The system should be independent of how its products are created, composed, and represented.
175177
* You need to configure the system with one of multiple families of products.
@@ -180,12 +182,12 @@ Use the Abstract Factory pattern when:
180182
* You need to choose which product to use from a family at runtime.
181183
* Adding new products or families should not require changes to existing code.
182184

183-
## Tutorials
185+
## Abstract Factory Pattern Java Tutorials
184186

185187
* [Abstract Factory Design Pattern in Java (DigitalOcean)](https://www.digitalocean.com/community/tutorials/abstract-factory-design-pattern-in-java)
186188
* [Abstract Factory(Refactoring Guru)](https://refactoring.guru/design-patterns/abstract-factory)
187189

188-
## Consequences
190+
## Benefits and Trade-offs of Abstract Factory Pattern
189191

190192
Benefits:
191193

@@ -203,21 +205,21 @@ Trade-offs:
203205

204206
* Indirectness: Client code interacts with products indirectly through factories, potentially reducing transparency.
205207

206-
## Known uses
208+
## Real-World Applications of Abstract Factory Pattern in Java
207209

208210
* Java Swing's `LookAndFeel` classes for providing different look-and-feel options.
209211
* Various implementations in the Java Abstract Window Toolkit (AWT) for creating different GUI components.
210212
* [javax.xml.parsers.DocumentBuilderFactory](http://docs.oracle.com/javase/8/docs/api/javax/xml/parsers/DocumentBuilderFactory.html)
211213
* [javax.xml.transform.TransformerFactory](http://docs.oracle.com/javase/8/docs/api/javax/xml/transform/TransformerFactory.html#newInstance--)
212214
* [javax.xml.xpath.XPathFactory](http://docs.oracle.com/javase/8/docs/api/javax/xml/xpath/XPathFactory.html#newInstance--)
213215

214-
## Related patterns
216+
## Related Java Design Patterns
215217

216218
* [Factory Method](https://java-design-patterns.com/patterns/factory-method/): Abstract Factory uses Factory Methods to create products.
217219
* [Singleton](https://java-design-patterns.com/patterns/singleton/): Abstract Factory classes are often implemented as Singletons.
218220
* [Factory Kit](https://java-design-patterns.com/patterns/factory-kit/): Similar to Abstract Factory but focuses on configuring and managing a set of related objects in a flexible way.
219221

220-
## Credits
222+
## References and Credits
221223

222224
* [Design Patterns: Elements of Reusable Object-Oriented Software](https://amzn.to/3w0pvKI)
223225
* [Design Patterns in Java](https://amzn.to/3Syw0vC)

active-object/README.md

+25-17
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
---
2-
title: Active Object
2+
title: "Active Object Pattern in Java: Achieving Efficient Asynchronous Processing"
3+
shortTitle: Active Object
4+
description: "Learn about the Active Object design pattern in Java. This guide covers asynchronous behavior, concurrency, and practical examples to enhance your Java applications' performance."
35
category: Concurrency
46
language: en
57
tag:
6-
- Asynchronous
7-
- Decoupling
8-
- Messaging
9-
- Synchronization
10-
- Thread management
8+
- Asynchronous
9+
- Decoupling
10+
- Messaging
11+
- Synchronization
12+
- Thread management
1113
---
1214

13-
## Intent
15+
## Intent of Active Object Design Pattern
1416

15-
The Active Object design pattern provides a safe and reliable way to implement asynchronous behavior in concurrent systems. It achieves this by encapsulating tasks within objects that have their own thread and message queue. This separation keeps the main thread responsive and avoids issues like direct thread manipulation or shared state access.
17+
The Active Object pattern provides a reliable method for asynchronous processing in Java, ensuring responsive applications and efficient thread management. It achieves this by encapsulating tasks within objects that have their own thread and message queue. This separation keeps the main thread responsive and avoids issues like direct thread manipulation or shared state access.
1618

17-
## Explanation
19+
## Detailed Explanation of Active Object Pattern with Real-World Examples
1820

1921
Real-world example
2022

@@ -39,7 +41,9 @@ Wikipedia says
3941
> * The implementation of the active object method.
4042
> * A callback or variable for the client to receive the result.
4143
42-
**Programmatic Example**
44+
## Programmatic Example of Active Object in Java
45+
46+
This section explains how the Active Object design pattern works in Java, highlighting its use in asynchronous task management and concurrency control.
4347

4448
The Orcs are known for their wildness and untameable soul. It seems like they have their own thread of control based on previous behavior. To implement a creature that has its own thread of control mechanism and expose its API only and not the execution itself, we can use the Active Object pattern.
4549

@@ -162,24 +166,28 @@ Program output:
162166
09:00:02.504 [Thread-2] INFO com.iluwatar.activeobject.ActiveCreature -- Orc2 has started to roam in the wastelands.
163167
```
164168

165-
## Applicability
169+
## When to Use the Active Object Pattern in Java
170+
171+
Use the Active Object pattern in Java when:
166172

167-
* When you need to perform long-running operations without blocking the main thread.
173+
* when you need to handle asynchronous tasks without blocking the main thread, ensuring better performance and responsiveness.
168174
* When you need to interact with external resources asynchronously.
169175
* When you want to improve the responsiveness of your application.
170176
* When you need to manage concurrent tasks in a modular and maintainable way.
171177

172-
## Tutorials
178+
## Active Object Pattern Java Tutorials
173179

174180
* [Android and Java Concurrency: The Active Object Pattern(Douglas Schmidt)](https://www.youtube.com/watch?v=Cd8t2u5Qmvc)
175181

176-
## Known Uses
182+
## Real-World Applications of Active Object Pattern in Java
177183

178184
* Real-time trading systems where transaction requests are handled asynchronously.
179185
* GUIs where long-running tasks are executed in the background without freezing the user interface.
180186
* Game programming to handle concurrent updates to game state or AI computations.
181187

182-
## Consequences
188+
## Benefits and Trade-offs of Active Object Pattern
189+
190+
Discover the benefits and trade-offs of using the Active Object pattern in Java, including improved thread safety and potential overhead concerns.
183191

184192
Benefits:
185193

@@ -193,13 +201,13 @@ Trade-offs:
193201
* Introduces additional overhead due to message passing and thread management.
194202
* May not be suitable for all types of concurrency problems.
195203

196-
## Related patterns
204+
## Related Java Design Patterns
197205

198206
* [Command](https://java-design-patterns.com/patterns/command/): Encapsulates a request as an object, similarly to how the Active Object pattern encapsulates method calls.
199207
* [Promise](https://java-design-patterns.com/patterns/promise/): Provides a means to retrieve the result of an asynchronous method call, often used in conjunction with Active Object.
200208
* [Proxy](https://java-design-patterns.com/patterns/proxy/): The Active Object pattern can use a proxy to handle method invocations asynchronously.
201209

202-
## Credits
210+
## References and Credits
203211

204212
* [Design Patterns: Elements of Reusable Object Software](https://amzn.to/3HYqrBE)
205213
* [Concurrent Programming in Java: Design Principles and Patterns](https://amzn.to/498SRVq)

0 commit comments

Comments
 (0)