Is this Factory Method creation pattern?

前端 未结 20 830
再見小時候
再見小時候 2020-12-12 17:12

I have been using factory method creation pattern for awhile now. I was just recently told that this:

public static class ScheduleTypeFactory
{
    public st         


        
20条回答
  •  抹茶落季
    2020-12-12 17:44

    Thats a textbook Factory Pattern.

    Some texts call it a Simple Factory Patteren, but I've never seen any criteria for what "Simple" means.

    In my practice, a Factory Pattern is any intelligent creation of a concrete class coresponding to a desired interface.

    But why fight your tech lead over naming a method. Rename it, move on with your life.

提交回复
热议问题