PCPP1 Advanced Object Oriented Programming Practice Question
In the context of the Factory pattern in Python, what is a typical benefit of using a registry-based approach instead of a large if-else block?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
It enables easy extension by adding new products without changing the factory.
Registry-based factories allow for decoupled code where new classes can be registered without modifying the factory's core logic.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
It guarantees thread safety without locks.
Why it's wrong here
A registry dictionary access is thread-safe for reads, but not necessarily writes.
- ✗
It prevents the instantiation of abstract classes.
Why it's wrong here
The factory logic itself should handle abstraction, not the registry.
- ✓
It enables easy extension by adding new products without changing the factory.
Why this is correct
This is the open/closed principle in action.
- ✗
It significantly reduces memory usage.
Why it's wrong here
Memory usage is negligible for either approach.
About these practice questions
This PCPP1 question is part of Courseiva's 209-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed August 2026 · checked against the official Python Institute exam blueprint
This PCPP1 practice question is part of Courseiva's free Python Institute certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCPP1 exam.