LINQtoCSV icon indicating copy to clipboard operation
LINQtoCSV copied to clipboard

Added IEntityFactory to abstract creation of entities during read.

Open dementeddevil opened this issue 11 years ago • 2 comments

Added IEntityFactory interface to abstract the process of creating new entity objects when reading a CSV stream.

This change allows the use of object-pooling semantics to reduce memory pressure when reading large CSV streams.

dementeddevil avatar Jul 09 '14 11:07 dementeddevil

Thanks for your pull request.

Before I go ahead with this, could you please add a description of this interface to the article.htm file, plus why it's there and how to use it. That way, others can use your work.

Additionally, please add unit test(s) that ensure the code still works after your change.

mperdeck avatar Jul 09 '14 13:07 mperdeck

Apologies!

In the end I ended up refactoring the CsvContext into CsvReadContext<T> and CsvWriteContext<T> which enabled me to use IEntityFactory<T> (instead of IEntityFactory) with the CsvReadContext<T> and thus made the implementation of IEntityFactory<T> much simpler. Obviously this is a breaking change compared to this pull request however if you are interested in seeing it (complete with unit tests and an example of it in use) then I'll generate a new pull request and back out of this one.

dementeddevil avatar Jul 22 '14 05:07 dementeddevil