iluwatar / iluwatar/java-design-patterns

Table Data Gateway pattern

Open
#1,318 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #1720 by @guapi777 — 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 Table Data Gateway pattern provides a way to encapsulate all the SQL operations for a single table or view within a gateway class. This pattern allows for a single point of access to the data in a table, ensuring a clean separation between the database and the application logic. The key elements of the Table Data Gateway pattern include:

  • Gateway Class: Encapsulates the database access logic for a specific table or view.
  • CRUD Operations: Methods for Create, Read, Update, and Delete operations.
  • Separation of Concerns: Decouples the SQL queries from the application logic, promoting single responsibility and easier maintenance.
  • Reusability: Reusable and testable components that centralize data access logic.
References:
  1. Martin Fowler's Table Data Gateway: https://www.martinfowler.com/eaaCatalog/tableDataGateway.html
  2. Wikipedia: Table Data Gateway: https://en.wikipedia.org/wiki/Table_data_gateway
  3. Source Code Examples: Table Data Gateway: https://www.sourcecodeexamples.net/2018/04/table-data-gateway.html
  4. P of EAA
Acceptance Criteria:
  1. Implement a gateway class that encapsulates SQL operations for a specific table.
  2. Include methods for Create, Read, Update, and Delete operations within the gateway class.
  3. Ensure that the gateway class is well-documented and includes unit tests to verify its functionality.

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

The issue names no files, tests, or entry points. Start by reviewing the repository's existing design-pattern implementations and database-related examples, then determine the table or view and API needed to satisfy the CRUD, documentation, and unit-test acceptance criteria.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.