Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by Amblikai (Scribe)
on May 21, 2019 at 16:59 UTC ( [id://11100333]=note: print w/replies, xml ) Need Help??


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]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11100333]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 22:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found