4 ms·
The factory pattern in Java exists because a type / a class is not a "first-class" concept. You can't pass around a class so that it gets constructed at some ot
by gugagore 3y ago
The factory pattern in Java exists because a type / a class is not a "first-class" concept. You can't pass around a class so that it gets constructed at some other point. Python (which I believe inherits from Smalltalk) has a different object system, which makes the factory pattern irrelevant.
- extasia 3y agoFactory pattern is still used in Python, for example in the popular huggingface library, Transformers.