Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Registration - "Redefining the Service Layer with Groovy Categories"
class LocalPaymentService implements PaymentService {
static {
use (PaymentTypeHandlerRegistrationCategory) {
CreditCardPaymentType.register(CreditCardPaymentProcessor)
GiftCardPaymentType.register(GiftCardPaymentProcessor)
EmployeePaymentType.register(EmployeePaymentProcessor)
CheckPaymentType.register(CheckPaymentProcessor)
}
}
public String process(PaymentType paymentType) {
// ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.