Supponiamo che la seguente classe DTO . Quale dei due getter interrompe l'incapsulamento minimo?
class Foo
{
public:
/*Return the most primitive type. Caller do not need
to worry about what Array is*/
const RecType* dataBeginGet() const;
const RecType* dataEndGet() const;
/*Return a reference to the Array.
Caller do not need to call two methods before iteration
*/
const Array<RecType>& dataGet() const
{return m_data;}
private:
Array<RecType> m_data;
};