mercredi 28 février 2018

Strategy pattern with return value

I try create Payment by strategy pattern. But All articles each I read look like this:

public interface PayStrategy {
    void pay(BigDecimal paymentAmount);
}

But if I need return Single<RestResponse<PaymentResponse>>?Is this the right approach?

public interface PayStrategy {
        Single<RestResponse<PaymentResponse>> pay(BigDecimal paymentAmount);
    }

Aucun commentaire:

Enregistrer un commentaire