iluwatar / iluwatar/java-design-patterns
Layer Supertype pattern
Nobody has claimed this yet.
- #1774 by @waterman6 — closed without merging
- 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:
- Layer Supertype: A common abstract base class or interface that provides shared methods and properties for all classes in the same layer.
- Inheritance: Concrete classes inherit from the layer supertype to gain common functionality.
- 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:
- Create an abstract base class or interface for the chosen layer (e.g., Service Layer, DAO Layer) that includes common properties and methods.
- Refactor existing classes in the chosen layer to inherit from the new layer supertype, ensuring they implement or utilize the common functionality.
- Update documentation and examples to demonstrate the use and benefits of the Layer Supertype pattern in the project.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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