Performance: CRUD methods (save, findById, findAll, delete)
MEDIUM IMPACT
This concept affects how quickly data operations respond and how much the UI waits for data changes, impacting user interaction speed and perceived responsiveness.
Page<Entity> findAll(Pageable pageable) { return repository.findAll(pageable); } // fetches data in pagesList<Entity> findAll() { return repository.findAll(); } // fetches all data without pagination| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Fetch all without pagination | N/A | N/A | Blocks UI update waiting for data | [X] Bad |
| Fetch with pagination | N/A | N/A | Allows incremental UI updates | [OK] Good |
| Save without check | N/A | N/A | Causes unnecessary DB writes delaying response | [X] Bad |
| Save with existence check | N/A | N/A | Reduces DB writes improving response | [OK] Good |
| Delete without check | N/A | N/A | May cause errors and wasted DB calls | [X] Bad |
| Delete with existence check | N/A | N/A | Avoids errors and unnecessary DB load | [OK] Good |