0

I have created a "simple" C# client library for an HTTP based API (So, think kind of REST.. but yet not.. but that aint important for this discussion anyways, but might be important for some context). The thing with this API is that it allows the client to send multiple requests in a "batch-request" (they call it a bulk request, however.. its just for Create, Update and Delete of resource.. and appears to only work for some specific types of resources).

So I decided to create a C# class (lets call it MyService for now) that holds a list of all operations that I want to preform againt the API, and once Im ready to execute the opeations it will figure out which operations it can send as a "batch/bulk request" and which requests needs to be sent one by one.

So for instance:

...
//Adds an "add operation" a person to the in memory list of operations..
myService.Persons.Create(person);

//Add an "update operation" of another person to the in memory list of operations..
myService.Persons.Update(person);

//Sends all the operations against the HTTP API (and figures out which operations to batch)
await myService.SendOperationsAsync();

Now to my question.. Would you say that this is a Unit Of Work pattern or a Context Object pattern or something different all along? Im just curious since I cant really figure this out myself.. (and Im fully aware that one shouldnt look into if code is pattern X or pattern Y, as long as it works it doesnt really make much of a difference.. but for a communications point of view It might matter.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.