mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-08-11 22:22:30 +00:00
docs: Content SEO updates (#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
This commit is contained in:
+17
-15
@@ -1,19 +1,21 @@
|
||||
---
|
||||
title: Composite View
|
||||
title: "Composite View Pattern in Java: Enhancing UI Consistency Across Applications"
|
||||
shortTitle: Composite View
|
||||
description: "Learn about the Composite View design pattern in Java, which helps in managing complex hierarchical views. This guide includes examples, applications, and benefits of using the Composite View pattern."
|
||||
category: Structural
|
||||
language: en
|
||||
tag:
|
||||
- Abstraction
|
||||
- Enterprise patterns
|
||||
- Object composition
|
||||
- Presentation
|
||||
- Abstraction
|
||||
- Enterprise patterns
|
||||
- Object composition
|
||||
- Presentation
|
||||
---
|
||||
|
||||
## Intent
|
||||
## Intent of Composite View Design Pattern
|
||||
|
||||
The primary goal of the Composite View design pattern is to compose objects into tree structures to represent part-whole hierarchies. This allows clients to treat individual objects and compositions of objects uniformly, simplifying the management of complex structures.
|
||||
The primary goal of the Composite View design pattern is to compose objects into tree structures to represent part-whole hierarchies. This allows clients to treat individual objects and compositions of objects uniformly, simplifying the management of complex hierarchical views.
|
||||
|
||||
## Explanation
|
||||
## Detailed Explanation of Composite View Pattern with Real-World Examples
|
||||
|
||||
Real-world example
|
||||
|
||||
@@ -27,7 +29,7 @@ Wikipedia says
|
||||
|
||||
> Composite views that are composed of multiple atomic subviews. Each component of the template may be included dynamically into the whole and the layout of the page may be managed independently of the content. This solution provides for the creation of a composite view based on the inclusion and substitution of modular dynamic and static template fragments. It promotes the reuse of atomic portions of the view by encouraging modular design.
|
||||
|
||||
**Programmatic Example**
|
||||
## Programmatic Example of Composite View Pattern in Java
|
||||
|
||||
A news site wants to display the current date and news to different users based on that user's preferences. The news site will substitute in different news feed components depending on the user's interest, defaulting to local news.
|
||||
|
||||
@@ -301,7 +303,7 @@ Under `Run` and `edit configurations` Make sure Tomcat server is one of the run
|
||||
|
||||
Ensure that the artifact is being built from the content of the `web` directory and the compilation results of the module. Point the output of the artifact to a convenient place. Run the configuration and view the landing page, follow instructions on that page to continue.
|
||||
|
||||
## Applicability:
|
||||
## When to Use the Composite View Pattern in Java
|
||||
|
||||
Use the Composite View design pattern when:
|
||||
|
||||
@@ -309,16 +311,16 @@ Use the Composite View design pattern when:
|
||||
* You expect that the composite structures might include any new components in the future.
|
||||
* You want clients to be able to ignore the difference between compositions of objects and individual objects. Clients will treat all objects in the composite structure uniformly.
|
||||
|
||||
## Tutorials
|
||||
## Composite View Pattern Java Tutorials
|
||||
|
||||
* [Composite View Design Pattern – Core J2EE Patterns (Dinesh on Java)](https://www.dineshonjava.com/composite-view-design-pattern/)
|
||||
|
||||
## Known Uses
|
||||
## Real-World Applications of Composite View Pattern in Java
|
||||
|
||||
* Graphical User Interfaces (GUIs) where widgets can contain other widgets (e.g., a window containing panels, buttons, and text fields).
|
||||
* Document structures, such as the representation of tables containing rows, which in turn contain cells, all of which can be treated as elements in a unified hierarchy.
|
||||
|
||||
## Consequences
|
||||
## Benefits and Trade-offs of Composite View Pattern
|
||||
|
||||
Benefits:
|
||||
|
||||
@@ -330,14 +332,14 @@ Trade-offs:
|
||||
* Overgeneralization: Designing the system might become more complex if you make everything composite, especially if your application doesn't require it.
|
||||
* Difficulty in constraint enforcement: It can be harder to restrict the components of a composite to only certain types.
|
||||
|
||||
## Related Patterns
|
||||
## Related Java Design Patterns
|
||||
|
||||
* [Composite](https://java-design-patterns.com/patterns/composite/): General structural pattern that is the foundation for Composite View, used for treating individual objects and compositions uniformly.
|
||||
* [Decorator](https://java-design-patterns.com/patterns/decorator/): Enhances the behavior of individual views without modifying the underlying view.
|
||||
* [Flyweight](https://java-design-patterns.com/patterns/flyweight/): Can be used to manage memory consumption of large numbers of similar view objects.
|
||||
* View Helper: Separates the view logic from business logic, aiding in the clean organization and management of view components.
|
||||
|
||||
## Credits
|
||||
## References and Credits
|
||||
|
||||
* [Head First Design Patterns: Building Extensible and Maintainable Object-Oriented Software](https://amzn.to/3xfntGJ)
|
||||
* [Patterns of Enterprise Application Architecture](https://amzn.to/49jpQG3)
|
||||
|
||||
Reference in New Issue
Block a user