iluwatar / iluwatar/java-design-patterns
Stored Procedures for Primary Keys pattern
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 94.7k
- Forks
- 27.4k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 10
Description
Description:
Implement the Stored Procedures for Primary Keys design pattern. This pattern centralizes the creation of primary key values in a database through stored procedures. The primary objective is to ensure unique and sequential key generation across different parts of an application. By utilizing stored procedures, this pattern enhances consistency, simplifies key management, and can improve performance by reducing the logic required in the application layer for key generation.
Main Elements:
- Centralized Key Generation: Use stored procedures to generate primary key values, ensuring uniqueness and sequential order.
- Database Consistency: Maintain consistent key generation across different application modules.
- Simplified Application Logic: Offload key generation logic from the application layer to the database.
- Performance Optimization: Reduce the overhead of key generation logic in the application, potentially improving overall performance.
References:
Acceptance Criteria:
- A stored procedure is created in the database to handle the generation of primary keys.
- The application layer is modified to call the stored procedure for primary key generation instead of generating keys within the application code.
- Comprehensive tests are implemented to ensure that the stored procedure generates unique and sequential primary key values and that the integration with the application is seamless.
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, database engine, or application entry point. Start with the Project Contribution Guidelines and the linked design-pattern source, then determine the database procedure and application integration scope. Done means a stored procedure generates unique sequential keys, the application calls it, and integration tests cover both behaviors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- backend, database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100