What are the practical uses of Factory Method Pattern?

前端 未结 6 905
闹比i
闹比i 2021-01-11 09:51

I\'m pretty new to Design Patterns.I just came across Factory Design Pattern. I understood that it delegates the instantiation to subclasses. But I didn\'t get the actual ap

6条回答
  •  生来不讨喜
    2021-01-11 10:30

    Admittedly the need for actual use of the more painful implementation details described by the pattern were removed thanks to the way C# works, but my SQL DAL functionality passes around object factories (and SQL commands) to utility functions that use the factories in order to generate objects. If I was not using C#, I suppose I could instead have used an explicit factory class that generated the objects.

提交回复
热议问题