Should a factory method be static?

No, factory class by default shouldn’t be static . Actually, static classes are not welcomed in OOP world since they can also convey some state and therefore introduce global application state. If you need only one factory object to be present, you can control it’s creation through singleton pattern.

Sizin İçin Seçtik  What is factory flutter?

Leave a Reply

Your email address will not be published. Required fields are marked *