1/26
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
What are the 3 layers of enterprise architecture (CSR)?
Controller (front door, handles HTTP), Service (brain, business logic), Repository (file room, CRUD only)
What is an Entity's only job?
Define what data exists and what gets stored in the database — no business logic, strip it lean
What are the 3 rules of a Java Bean?
1) Default no-arg constructor, 2) Getters and Setters for all properties, 3) Booleans use "is" prefix (e.g. isActive())
What is ORM?
Translator between Java objects and database tables — you write Java, it generates SQL automatically
What are the 4 ORM association types?
One-to-One, One-to-Many, Many-to-One, Many-to-Many
When do you convert Many-to-Many into two Many-to-Ones?
When the join table has its own data that changes over time (e.g. CourseRegistration stores grade and date)
What is Lazy Loading?
Don't fetch related data until you call the getter — fires a second DB query only when needed
What is Eager Loading and when is it dangerous?
Loads everything immediately including all associations — dangerous with deep nesting, can load the entire database in one request
What is the N+1 Problem?
1 query to get a list + N queries (one per item) to get each item's associations = potentially 100+ queries for one page
What does JOIN FETCH do?
Overrides lazy loading for one specific query, loading associated data eagerly in a single SQL join — fixes N+1
What is HQL?
Hibernate Query Language — like SQL but queries Java objects and properties instead of tables and columns
Difference between INNER JOIN and OUTER/LEFT JOIN?
Inner = only rows where both sides match. Outer/Left = all rows from left side, even with no match (nulls on right)
What is Dependency Injection (DI) and IoC?
Instead of a class creating its own dependencies with "new", Spring creates and injects them automatically — like a staffing agency delivering workers
What does @Autowired do?
Tells Spring to automatically inject the matching registered component — no "new" keyword needed
What are the 5 Spring stereotype annotations and their layers?
@RestController (Presentation), @Service (Business), @Repository (Persistence), @Entity (Data Model), @Component (Generic/Any)
Why should you NEVER use @RepositoryRestResource in production?
It exposes your entire repository to the public REST API with no security layer — anyone can read, modify, or delete data
What does HTTP status 201 mean?
Successfully Created — returned when a POST request creates a new resource
What is a DTO (Data Transfer Object)?
A simple object that carries only the needed fields between layers (HTTP → Service) — prevents over-exposing your data model
What is OCL (Object Constraint Language)?
A formal language for expressing constraints on a UML model before coding — not a programming language, used by analysts
What are the 3 parts of an OCL statement?
1) Context (which class the rule applies to), 2) Constraint type (inv/pre/post), 3) Expression (the actual rule)
Difference between synchronous and asynchronous communication?
Synchronous = wait for response (phone call). Asynchronous = send and move on, receiver processes later (text message)
What is a Message Broker (e.g. RabbitMQ)?
Sits between apps and manages message delivery — decouples sender/receiver, messages persist even if receiver is down
Difference between a Queue and a Topic in messaging?
Queue = one message delivered to ONE receiver. Topic (Pub/Sub) = one message delivered to ALL subscribers
Why do transactions and locking matter in the business layer?
Prevent race conditions — e.g. two users booking the last seat simultaneously, transactions make operations atomic (all-or-nothing)
What is the 17-line rule for Java methods?
If a method exceeds ~17 lines, refactor it — it's doing too much. Enterprise libraries handle complexity, long methods = poor design
What is pagination and why does it matter?
Loading data in chunks (e.g. 20 at a time) instead of all at once — prevents crashes and slowdowns with large datasets
What is the Git commit rule for team projects?
Every commit should be small, frequent, and tied to a specific issue/task — makes contributions traceable and fairly measurabl