iluwatar / iluwatar/java-design-patterns
Table Data Gateway pattern
Nobody has claimed this yet.
- #1720 by @guapi777 — closed without merging
- 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:
- Martin Fowler's Table Data Gateway: https://www.martinfowler.com/eaaCatalog/tableDataGateway.html
- Wikipedia: Table Data Gateway: https://en.wikipedia.org/wiki/Table_data_gateway
- Source Code Examples: Table Data Gateway: https://www.sourcecodeexamples.net/2018/04/table-data-gateway.html
- P of EAA
Acceptance Criteria:
- Implement a gateway class that encapsulates SQL operations for a specific table.
- Include methods for Create, Read, Update, and Delete operations within the gateway class.
- Ensure that the gateway class is well-documented and includes unit tests to verify its functionality.
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
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