java-design-patterns icon indicating copy to clipboard operation
java-design-patterns copied to clipboard

Row Data Gateway pattern

Open iluwatar opened this issue 4 years ago • 7 comments

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.

iluwatar avatar Jul 07 '20 18:07 iluwatar

Could I work on this? @iluwatar

tao-ny avatar May 17 '21 03:05 tao-ny

Sure thing @tao-ny

Please mention a timeline for when can we expect a PR against this issue.

ohbus avatar May 17 '21 08:05 ohbus

I will finish it within a week.

tao-ny avatar May 17 '21 16:05 tao-ny

Hi, Can I work on this issue?

ShawnMaxShen avatar Oct 12 '22 03:10 ShawnMaxShen

Ok @ShawnMaxShen

iluwatar avatar Oct 13 '22 17:10 iluwatar

@BorisBDing bro, we can have a discussion privately. Your comment may make maintainer a little confusing. (For maintianer, me and Boris are working together~)

ShawnMaxShen avatar Oct 17 '22 16:10 ShawnMaxShen

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 28 '22 12:11 stale[bot]