[
https://issues.apache.org/jira/browse/ARIES-1880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16734420#comment-16734420
]
Timothee Maret edited comment on ARIES-1880 at 1/4/19 6:08 PM:
---------------------------------------------------------------
FWIW, using a Builder looks like a good approach to me.
-The current PR seems to include a slightly different approach than the builder
pattern though. If we use the actual pattern (all building method return a
{{SubscribeRequestBuilder}}, a {{build}} method return the actual
{{SubscribeRequest}}) then we could add some checks in the builder that would
allow to enforce, for instance, that the Seek parameter is set.-
Ah, scratched the above after a second look, Seek has a default value set ..
lgtm ;-)
was (Author: marett):
FWIW, using a Builder looks like a good approach to me. The current PR seems to
include a slightly different approach than the builder pattern though. If we
use the actual pattern (all building method return a
{{SubscribeRequestBuilder}}, a {{build}} method return the actual
{{SubscribeRequest}}) then we could add some checks in the builder that would
allow to enforce, for instance, that the Seek parameter is set.
> Use builder instead of many parameters in subscribe
> ---------------------------------------------------
>
> Key: ARIES-1880
> URL: https://issues.apache.org/jira/browse/ARIES-1880
> Project: Aries
> Issue Type: Improvement
> Components: Journaled Events
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Subscription subscribe(String topic, Position position, Seek seek,
> Consumer<Received> callback);
> 4 Parameters which can partly be null is not a good idea. [~alien11689]
> proposed on the list to use a DTO.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)