I firmly agree with Holub's article about encapsulating implementation. But, using every field as object instead of primitive, such as, referring to Employee class example, Name, EmployeeId, Money and creating a new one either when importing or when exporting (with toString() or String.valueOf(value) methods), means creating a lot of objects, which in case of big iterations could require more memory and many garbage collections. This happens implementing this solution in my project. Probably I didn't catch in the right way the solution, hence It would be interesting to understand how to deal with different primitive type, avoiding parsing or string conversion.
|