iluwatar / iluwatar/java-design-patterns
Row Data Gateway pattern
Nobody has claimed this yet.
- #1763 by @tao-ny — closed without merging
- 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:
- Gateway Class: Represents a single row in the database, providing methods for CRUD (Create, Read, Update, Delete) operations.
- Database Access Encapsulation: Database queries and updates are encapsulated within the gateway class, abstracting the underlying database interaction.
- Separation of Concerns: Business logic is separated from database access logic, promoting clean code architecture.
- Consistency: Ensures data consistency by managing row-level data operations through the gateway class.
References:
- Row Data Gateway - Wikipedia
- Row Data Gateway - Martin Fowler
- Patterns of Enterprise Application Architecture by Martin Fowler
- Project Contribution Guidelines
- Row Data Gateway
Acceptance Criteria:
- Create a gateway class representing a single row in a database table, with methods for Create, Read, Update, and Delete operations.
- Ensure that the gateway class encapsulates all database access logic, separating it from the business logic.
- Provide unit tests demonstrating the functionality of the gateway class, including CRUD operations and data consistency.
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 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