Skip to content

Commit

Permalink
docs: Content SEO updates (#2990)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
iluwatar committed Jun 8, 2024
1 parent cb946c0 commit 6cd2d03
Show file tree
Hide file tree
Showing 219 changed files with 3,308 additions and 2,819 deletions.
38 changes: 20 additions & 18 deletions abstract-document/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
---
title: Abstract Document
title: "Abstract Document Pattern in Java: Simplifying Data Handling with Flexibility"
shortTitle: Abstract Document
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."
category: Structural
language: en
tag:
- Abstraction
- Decoupling
- Dynamic typing
- Encapsulation
- Extensibility
- Polymorphism
- Abstraction
- Decoupling
- Dynamic typing
- Encapsulation
- Extensibility
- Polymorphism
---

## Intent
## Intent of Abstract Document Design Pattern

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.
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.

## Explanation
## Detailed Explanation of Abstract Document Pattern with Real-World Examples

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.
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.

Real-world example

> 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.
> 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.
In plain words

Expand All @@ -31,7 +33,7 @@ Wikipedia says

> 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.
**Programmatic Example**
## Programmatic Example of Abstract Document Pattern in Java

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.

Expand Down Expand Up @@ -177,13 +179,13 @@ The program output:
07:21:57.395 [main] INFO com.iluwatar.abstractdocument.App -- door/Lambo/300
```
## Class diagram
## Abstract Document Pattern Class Diagram
![Abstract Document](./etc/abstract-document.png "Abstract Document Traits and Domain")
## Applicability
## When to Use the Abstract Document Pattern in Java
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:
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:
* 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.
Expand All @@ -209,7 +211,7 @@ This pattern is particularly useful in scenarios where you have different types

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.

## Consequences
## Benefits and Trade-offs of Abstract Document Pattern

Benefits:

Expand All @@ -227,7 +229,7 @@ Trade-offs:

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

## Credits
## References and Credits

* [Design Patterns: Elements of Reusable Object-Oriented Software](https://amzn.to/3w0pvKI)
* [Java Design Patterns: A Hands-On Experience with Real-World Examples](https://amzn.to/3yhh525)
Expand Down
42 changes: 22 additions & 20 deletions abstract-factory/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
---
title: Abstract Factory
title: "Abstract Factory Pattern in Java: Mastering Object Creation Elegantly"
shortTitle: Abstract Factory
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."
category: Creational
language: en
tag:
- Abstraction
- Decoupling
- Gang of Four
- Instantiation
- Polymorphism
- Abstraction
- Decoupling
- Gang of Four
- Instantiation
- Polymorphism
---

## Also known as

* Kit

## Intent
## Intent of Abstract Factory Design Pattern

Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
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.

## Explanation
## Detailed Explanation of Abstract Factory Pattern with Real-World Examples

Real-world example

> 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.
> 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.
>
> 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.
Expand All @@ -34,9 +36,9 @@ Wikipedia says

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

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.
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.

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

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

## Class diagram
## Abstract Factory Pattern Class Diagram

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

## Applicability
## When to Use the Abstract Factory Pattern in Java

Use the Abstract Factory pattern when:
Use the Abstract Factory pattern in Java when:

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

## Tutorials
## Abstract Factory Pattern Java Tutorials

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

## Consequences
## Benefits and Trade-offs of Abstract Factory Pattern

Benefits:

Expand All @@ -203,21 +205,21 @@ Trade-offs:

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

## Known uses
## Real-World Applications of Abstract Factory Pattern in Java

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

## Related patterns
## Related Java Design Patterns

* [Factory Method](https://java-design-patterns.com/patterns/factory-method/): Abstract Factory uses Factory Methods to create products.
* [Singleton](https://java-design-patterns.com/patterns/singleton/): Abstract Factory classes are often implemented as Singletons.
* [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.

## Credits
## References and Credits

* [Design Patterns: Elements of Reusable Object-Oriented Software](https://amzn.to/3w0pvKI)
* [Design Patterns in Java](https://amzn.to/3Syw0vC)
Expand Down
42 changes: 25 additions & 17 deletions active-object/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
---
title: Active Object
title: "Active Object Pattern in Java: Achieving Efficient Asynchronous Processing"
shortTitle: Active Object
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."
category: Concurrency
language: en
tag:
- Asynchronous
- Decoupling
- Messaging
- Synchronization
- Thread management
- Asynchronous
- Decoupling
- Messaging
- Synchronization
- Thread management
---

## Intent
## Intent of Active Object Design Pattern

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.
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.

## Explanation
## Detailed Explanation of Active Object Pattern with Real-World Examples

Real-world example

Expand All @@ -39,7 +41,9 @@ Wikipedia says
> * The implementation of the active object method.
> * A callback or variable for the client to receive the result.
**Programmatic Example**
## Programmatic Example of Active Object in Java

This section explains how the Active Object design pattern works in Java, highlighting its use in asynchronous task management and concurrency control.

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.

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

## Applicability
## When to Use the Active Object Pattern in Java

Use the Active Object pattern in Java when:

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

## Tutorials
## Active Object Pattern Java Tutorials

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

## Known Uses
## Real-World Applications of Active Object Pattern in Java

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

## Consequences
## Benefits and Trade-offs of Active Object Pattern

Discover the benefits and trade-offs of using the Active Object pattern in Java, including improved thread safety and potential overhead concerns.

Benefits:

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

## Related patterns
## Related Java Design Patterns

* [Command](https://java-design-patterns.com/patterns/command/): Encapsulates a request as an object, similarly to how the Active Object pattern encapsulates method calls.
* [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.
* [Proxy](https://java-design-patterns.com/patterns/proxy/): The Active Object pattern can use a proxy to handle method invocations asynchronously.

## Credits
## References and Credits

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

0 comments on commit 6cd2d03

Please sign in to comment.