iluwatar / iluwatar/java-design-patterns

Row Data Gateway pattern

Open
#1,312 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #1763 by @tao-ny — 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 Row Data Gateway pattern provides an object-oriented interface to a single row in a database table, encapsulating the database access logic within a gateway class. This pattern allows for a clear separation between business logic and database operations, enabling more maintainable and testable code.

Main Elements of the Pattern:
  1. Gateway Class: Represents a single row in the database, providing methods for CRUD (Create, Read, Update, Delete) operations.
  2. Database Access Encapsulation: Database queries and updates are encapsulated within the gateway class, abstracting the underlying database interaction.
  3. Separation of Concerns: Business logic is separated from database access logic, promoting clean code architecture.
  4. Consistency: Ensures data consistency by managing row-level data operations through the gateway class.
References:
  1. Row Data Gateway - Wikipedia
  2. Row Data Gateway - Martin Fowler
  3. Patterns of Enterprise Application Architecture by Martin Fowler
  4. Project Contribution Guidelines
  5. Row Data Gateway
Acceptance Criteria:
  1. Create a gateway class representing a single row in a database table, with methods for Create, Read, Update, and Delete operations.
  2. Ensure that the gateway class encapsulates all database access logic, separating it from the business logic.
  3. Provide unit tests demonstrating the functionality of the gateway class, including CRUD operations and data consistency.

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 reviewing the project contribution guidelines and existing Java design-pattern implementations to determine the expected structure for a new pattern. Use the acceptance criteria as the completion checklist: provide a row gateway with CRUD operations, encapsulate database access, and add unit tests covering CRUD behavior and data consistency.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.