filmov
tv
Factory Pattern Example And Its Advantage #shorts
Показать описание
A very common and most used pattern in software development is the factory pattern. It is used for creating objects based on the client’s passed parameter.
We have taken an example of a Car factory here and explained how the car factory is used to create different variants of cars.
Two major advantages of Factory patterns are achieving separation of concern which reduces the coupling in the code. And second is encapsulation, where the entire logic of object creation is encapsulated within the factory class so the clients or any other external classes will not be able to affect the creation logic. #shorts #youtubeshorts
We have taken an example of a Car factory here and explained how the car factory is used to create different variants of cars.
Two major advantages of Factory patterns are achieving separation of concern which reduces the coupling in the code. And second is encapsulation, where the entire logic of object creation is encapsulated within the factory class so the clients or any other external classes will not be able to affect the creation logic. #shorts #youtubeshorts