Where is the Factory and Abstract factory Used

Hi, I need to know For Parking Slot Problem In beginning it’s initialize to use factory pattern. But in final code I don’t see any use of Factory and Abstract Factory Design pattern

Course: Grokking the Low Level Design Interview Using OOD Principles - Learn Interactively
Lesson: Code for the Parking Lot - Grokking the Low Level Design Interview Using OOD Principles

Hi @vishal_garg,

We agree with what you’re saying. However, the code not implementing the said design patterns doesn’t necessarily indicate a problem. We have various strategies and design patterns available, such as Factory pattern and Abstract Factory pattern, which can be effective in specific situations. The choice of a design pattern depends on factors like project complexity, maintainability, and timelines.

In this code, simplicity has been prioritized, leading to the absence of explicit design patterns. It’s important to note that our design solutions may not always include all mentioned design patterns. We provide foundational knowledge and encourage learners to explore and adapt design patterns to suit their needs. Different problems may require different approaches, and we support flexibility in finding solutions that align with individual preferences and project requirements.

Happy Learning :slight_smile: