SFWE 405 Midterm 1 study guide

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/26

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 7:09 AM on 5/10/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

27 Terms

1
New cards

What are the 3 layers of enterprise architecture (CSR)?

Controller (front door, handles HTTP), Service (brain, business logic), Repository (file room, CRUD only)

2
New cards

What is an Entity's only job?

Define what data exists and what gets stored in the database — no business logic, strip it lean

3
New cards

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())

4
New cards

What is ORM?

Translator between Java objects and database tables — you write Java, it generates SQL automatically

5
New cards

What are the 4 ORM association types?

One-to-One, One-to-Many, Many-to-One, Many-to-Many

6
New cards

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)

7
New cards

What is Lazy Loading?

Don't fetch related data until you call the getter — fires a second DB query only when needed

8
New cards

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

9
New cards

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

10
New cards

What does JOIN FETCH do?

Overrides lazy loading for one specific query, loading associated data eagerly in a single SQL join — fixes N+1

11
New cards

What is HQL?

Hibernate Query Language — like SQL but queries Java objects and properties instead of tables and columns

12
New cards

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)

13
New cards

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

14
New cards

What does @Autowired do?

Tells Spring to automatically inject the matching registered component — no "new" keyword needed

15
New cards

What are the 5 Spring stereotype annotations and their layers?

@RestController (Presentation), @Service (Business), @Repository (Persistence), @Entity (Data Model), @Component (Generic/Any)

16
New cards

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

17
New cards

What does HTTP status 201 mean?

Successfully Created — returned when a POST request creates a new resource

18
New cards

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

19
New cards

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

20
New cards

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)

21
New cards

Difference between synchronous and asynchronous communication?

Synchronous = wait for response (phone call). Asynchronous = send and move on, receiver processes later (text message)

22
New cards

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

23
New cards

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

24
New cards

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)

25
New cards

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

26
New cards

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

27
New cards

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