iluwatar / iluwatar/java-design-patterns

Facet pattern

Open
#88 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #1717 by @wangihzyue — closed without merging
epic: pattern info: help wanted type: feature
Dominant language
Java
Stars
94.7k
Forks
27.4k
Avg merge
3d 4h
Merged PRs (30d)
10

Description

Description:

The Facet design pattern is used to represent different aspects or views of an object, allowing an object to expose multiple interfaces that reflect different facets of its functionality. This pattern is useful in situations where an object needs to be interacted with in various ways depending on the context or role.

Main Elements of the Facet Design Pattern:

  1. Core Object: The primary object that contains the core data and functionality.
  2. Facet Interfaces: Interfaces that represent different aspects or views of the core object. Each interface provides a specific subset of the core object's functionality.
  3. Facet Implementations: Concrete classes that implement the facet interfaces, often acting as wrappers around the core object to provide the necessary views or functionalities.
References:
Acceptance Criteria:
  1. A core object should be identified or created that contains the primary data and functionality.
  2. Multiple facet interfaces should be defined, each representing a different view or aspect of the core object.
  3. Concrete classes implementing the facet interfaces should be created, providing the necessary views or functionalities by interacting with the core object.
  4. Unit tests should be written to ensure that the facet interfaces and their implementations correctly interact with the core object and provide the expected functionalities.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the Java project conventions and the closed linked pull request #1717 before starting, since no source files or test paths are named. Use the acceptance criteria as the completion checklist: a core object, multiple facet interfaces and implementations, plus unit tests showing their interactions and expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.