Photon interview question

describe factory pattern