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

Table Data Gateway pattern

Open iluwatar opened this issue 4 years ago • 6 comments

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.

iluwatar avatar Jul 07 '20 18:07 iluwatar

Can I work on this issue?

guapi777 avatar Apr 20 '21 12:04 guapi777

Sure thing @guapi777

We are happy to have you here!

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

Good luck 💯

ohbus avatar Apr 20 '21 15:04 ohbus

I will fix this issue within one week. :)

guapi777 avatar Apr 21 '21 04:04 guapi777

Hi, could you assign this issue to me please? I am interested in fixing this issue.

u7147694 avatar Oct 12 '22 11:10 u7147694

All right @u7147694

iluwatar avatar Oct 13 '22 17:10 iluwatar

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]