iluwatar / iluwatar/java-design-patterns

Layer Supertype pattern

Open
#1,302 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #1774 by @waterman6 — 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 Layer Supertype design pattern is used to provide a common base class for all objects in a particular layer. This pattern simplifies code maintenance and enforces consistency across similar objects. By implementing a layer supertype, we can centralize common behaviors and properties, reduce code duplication, and facilitate easier modifications and extensions in the future.

Main elements of the pattern:
  1. Layer Supertype: A common abstract base class or interface that provides shared methods and properties for all classes in the same layer.
  2. Inheritance: Concrete classes inherit from the layer supertype to gain common functionality.
  3. Separation of Concerns: This pattern helps in maintaining a clear separation between different layers of the application, making the code more modular and easier to manage.
References:
Acceptance Criteria:
  1. Create an abstract base class or interface for the chosen layer (e.g., Service Layer, DAO Layer) that includes common properties and methods.
  2. Refactor existing classes in the chosen layer to inherit from the new layer supertype, ensuring they implement or utilize the common functionality.
  3. Update documentation and examples to demonstrate the use and benefits of the Layer Supertype pattern in the project.

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

Start by reading the Layer Supertype references linked in the issue and reviewing the project's existing pattern organization; no file, test, or entry point is named. Resolve which layer is in scope, then identify the affected classes and documentation locations. Done means the supertype, refactored classes, and usage examples satisfy all three acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.