A
A
artshelom2018-08-03 20:59:30
Design patterns
artshelom, 2018-08-03 20:59:30

How to understand factory class in factory method class??

I'm trying to figure out the factory pattern, but I can't really understand why the Factory is needed.
I'm looking at an example from this site . What is the point of the "ParserFactory" class, if you can just write the same thing in the method by getting rid of the class??

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Spiridonov, 2018-08-03
@artshelom

To make it easier to program later. Without understanding what is behind the interface. Everything is on the shelves, predictably structured and predictably behaves.
A long time ago I thought that OOP and patterns were generally only relevant "for large projects". When I stopped thinking like that, I started developing 5 times faster.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question