Skip to content

Replace factory with builder when creating operation requests/responses #886

Open
@AugustoRavazoli

Description

@AugustoRavazoli

Both the OperationRequestFactory and OperationResponseFactory leads to unnecessary code in custom pre-processors:

new OperationRequestFactory().create(
  uri,
  request.getMethod(),
  request.getContent(),
  headers,
  request.getParts(),
  cookies
);

A possible way to simplify the request creation is to use the Builder design pattern:

new OperationRequestBuider(request)
  .withUri(uri)
  .withHeaders(headers)
  .withCookies(cookies)
  .build();

The OperationRequestBuilder will builds the new request using the request argument fields as defaults, like a StringBuilder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: blockedBlocked on a change in an external projecttype: enhancementEnhancement that adds a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions