What is a name for a pattern where it receives data or asks for data and returns back an object?
问题 Question 1 Is there a name for the pattern below? class Pattern { function createObject(array $data) { $object = new Object(); $object->setPropertyA($data['A']); $object->setPropertyB($data['B']); $object->setPropertyC($data['C']); return $object; } } Question 2 Is there a name for the above pattern if it is altered to where $data is acquired inside the method? Specifically code below: class Pattern2 { function createObject() { $data = $this->service->acquireData(); $object = new Object();