in reply to Re: Using a factory class to return objects of the same class
in thread Using a factory class to return objects of the same class

If i was using a builder method(s) to handle the configuration of the object, how would i go about seperating the configuration from the incoming data (since the data is somewhat arbitrary)?

I'm thinking of just using class methods/variables to set up the configuration of the class before creating objects

  • Comment on Re^2: Using a factory class to return objects of the same class

Replies are listed 'Best First'.
Re^3: Using a factory class to return objects of the same class
by choroba (Cardinal) on May 21, 2019 at 18:53 UTC
    Builder is not a method, it's an object. Its constructor takes the configuration, and its ->build method takes the data as an argument.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]