I have a complex builder pattern implemented in the code similar to the last one in this URL. The purpose of the builders are to construct the SQL query based on the object properties.
Something like
PersonQueryBuilder person =
new PersonQueryBuilder.Builder()
.BuildAddressClause(request.PersonInformation.Address)
.BuildBankAccountClause(request.PersonInformation.BankAccountInformation)
.BuildAClause(request.Something)
.BuildBClause(request.Something)
.build();
I was thinking, instead of sequential execution of these builder logics, it would be more efficient if I could run them with
TaskFactory.StartNew(() =>
{
// Create builder here so that the builder pattern stays the same, but the process runs concurrently.
});
Is there any way/example that can demonstrate similar behavior?
Aucun commentaire:
Enregistrer un commentaire