Database Design and Integration Part 2
A presentation deck for Week 5 that explains the repository layer, application properties, table relationships, and integration testing in a Spring-based database application.
- Covers the four Week 5 topics in an expanded slide deck.
- Designed for teaching, revision, and database integration discussion.
- Use arrow keys, buttons, or slide dots to navigate.
Focus
Week 5 Presentation
Use
Teach this page live or review it before class.
What this week is about
Week 5 is about connecting schema design to code, configuration, and testing.
- 4.6 Repository Layer
- 4.7 Application properties
- 4.8 Table Relationships
- 4.9 Testing Integration
Focus
Overview
Use
Teach this page live or review it before class.
Repositories isolate persistence logic
Repositories keep data access separate from controllers and services so the application stays organized.
- Repositories expose persistence operations as a contract.
- Services call repositories rather than embedding SQL.
- Spring Data JPA can generate much of the implementation.
Focus
4.6 Repository Layer
Use
Teach this page live or review it before class.
Layered architecture improves maintainability
When responsibilities are separated, each layer is easier to understand, change, and test.
- Controllers handle HTTP requests.
- Services handle business rules.
- Repositories handle database access.
Focus
4.6 Layering
Use
Teach this page live or review it before class.
Configuration lives outside the code
Application properties store database and JPA settings so environments can be changed without rewriting source code.
- Database URLs, usernames, and passwords belong in configuration.
- Profiles separate development, test, and production values.
- JPA and Hibernate options can be tuned per environment.
Focus
4.7 Application properties
Use
Teach this page live or review it before class.
Profiles make deployments predictable
Different profiles let the same code run against different databases and settings safely.
- Development can use a local database.
- Test can use an isolated test database.
- Production can use secure deployed settings.
Focus
4.7 Environments
Use
Teach this page live or review it before class.
Relationships connect tables correctly
One-to-one, one-to-many, and many-to-many relationships define how data is linked across the schema.
- Foreign keys connect related records.
- Many-to-many relationships usually need a join table.
- Good relationship design reduces duplication.
Focus
4.8 Table Relationships
Use
Teach this page live or review it before class.
Relationship mapping shapes queries
Schema relationships should match how the application reads and writes connected data.
- One-to-many is common for parent and child records.
- Join tables support many-to-many links.
- Mappings should stay consistent with the ER model.
Focus
4.8 Mapping
Use
Teach this page live or review it before class.
Integration tests verify the whole path
Integration testing checks that repository, configuration, and database pieces work together as a complete flow.
- Use test context or test database support.
- Check real persistence behavior rather than only mocks.
- Catch schema and query problems before release.
Focus
4.9 Testing Integration
Use
Teach this page live or review it before class.
Testing gives safer change
When the data layer is covered by integration tests, teams can refactor with more confidence.
- Repository tests validate the data access path.
- Application changes stay safer after schema updates.
- Regression risks are lower when tests are realistic.
Focus
4.9 Confidence
Use
Teach this page live or review it before class.
What students should remember
Week 5 is about the application layer around the database and how to keep it testable and maintainable.
- Repositories isolate persistence.
- Properties control configuration.
- Relationships and tests keep the database layer reliable.
Focus
Recap
Use
Teach this page live or review it before class.