I'm writing a Gateway class that extracts information from a HTML document. One of the responsibilities of the class is to traverse a table in the document and extract data from its rows. I'm trying to decide how to best represent a row, and I've come up with two solutions (in semi-pseudo code).I could represent each row as an associative array:class Gateway{    private $crawler;    public function __construct($crawler)    {        $this->crawler = $crawler;    }    public function getRows()    {        $this->crawler->xpath('...')->each(function($node, $i)        {            return [                'someInfo'      => $node->xpath('...'),                'someOtherInfo' => $node->xpath('...')            ];        });    }}I could alternatively wrap each row in its own Gateway (however, I don't know if it's good practice to be hard-coding instantiation like this):class Gateway{    private $crawler;    public function __construct($crawler)    {        $this->crawler = $crawler;    }    public function getRows()    {        $this->crawler->xpath('...')->each(function($node, $i)        {            return new RowGateway($node);        });    }}class RowGateway{    private $crawler;    public function __construct($crawler)    {        $this->crawler = $crawler;    }    public function getSomeInfo()    {        return $node->xpath('...');    }    public function getSomeOtherInfo()    {        return $node->xpath('...');    }}Which is the preferable approach here? I'm open to other designs, too.
Which is the preferable design for my Gateway?
design patterns;domain driven design