Why is DataTable faster than DataReader

I see three issues: the way you use a DataReader negates it’s big single-item-in-memory advantage by converting it to list, you’re running the benchmark in an environment that differs significantly from production in a way that favors the DataTable, and you’re spending time converting DataReader record to Artifact objects that is not duplicated in the … Read more

Should the repository layer return data-transfer-objects (DTO)?

Short answer: No. Long answer: repository is responsible for turning persisted data back to entities (models) and vice versa. Model is a business Model representing a business entity. DTO on the other hand – while looks like Model – is concerned with transfer of the object between various environment and in essence is a transient … Read more

Is UnitOfWork equals Transaction? Or it is more than that?

A UnitOfWork is a business transaction. Not necessarily a technical transaction (db transaction) but often tied to technical transactions. In the enterprise application patterns it is defined as Maintains a list of objects affected by a business transaction and coordinates the writing out of changes and the resolution of concurrency problems. It does not define … Read more

What is the difference between DAO and Repository patterns?

DAO is an abstraction of data persistence. Repository is an abstraction of a collection of objects. DAO would be considered closer to the database, often table-centric. Repository would be considered closer to the Domain, dealing only in Aggregate Roots. Repository could be implemented using DAO‘s, but you wouldn’t do the opposite. Also, a Repository is … Read more

Separation of business logic and data access in django

It seems like you are asking about the difference between the data model and the domain model – the latter is where you can find the business logic and entities as perceived by your end user, the former is where you actually store your data. Furthermore, I’ve interpreted the 3rd part of your question as: how … Read more

tech