Flashcards

Quick study sessions to strengthen memory and retain key concepts.

Flashcard Study

Java: Factory Pattern

Front

Common Pitfall of Factory Pattern?

Overcomplicating simple object creation. Frame the concept in practical terms so you can explain it during interview discussion.…

View Card →
Flashcard Study

Java: Factory Pattern

Front

Factory Pattern vs. Concrete Instantiation?

Factory abstracts creation logic. Frame the concept in practical terms so you can explain it during interview discussion.…

View Card →
Flashcard Study

Java: Factory Pattern

Front

Factory Pattern and Spring?

Spring IoC acts like a super-factory. Frame the concept in practical terms so you can explain it during…

View Card →
Flashcard Study

Java: Factory Pattern

Front

Advantages of Factory Pattern?

Factories promote loose coupling. Frame the concept in practical terms so you can explain it during interview discussion.…

View Card →
Flashcard Study

Java: Factory Pattern

Front

Understanding the Factory Pattern?

The Factory Pattern centralizes object creation. The Factory Pattern provides a way to centralize the creation of objects,…

View Card →
Flashcard Study

Java: Factory Pattern

Front

What testing benefit comes from a stable `PaymentGateway` seam?

Checkout can be tested against one contract while vendor mapping stays isolated in adapter tests. A clean integration…

View Card →
Flashcard Study

Java: Factory Pattern

Front

Why combine Factory and Adapter at a payment boundary?

The factory selects the provider and the adapter hides vendor-specific API shape. Real payment integrations often need more…

View Card →
Flashcard Study

Java: Decorator Pattern

Front

How can the Decorator Pattern dynamically extend an object's functionality without altering its structure?

By wrapping the object with a new class that adds additional behavior. The Decorator Pattern allows you to…

View Card →
Flashcard Study

Java: Decorator Pattern

Front

What are common mistakes to avoid when implementing the Decorator pattern?

Creating cyclic dependencies and ignoring performance impacts. A common mistake is introducing cyclic dependencies between decorators, which can…

View Card →
Flashcard Study

Java: Decorator Pattern

Front

How can the Decorator pattern prevent over-engineering?

By providing a simple way to add features without complex inheritance. The Decorator pattern offers a straightforward mechanism…

View Card →