Created
May 29, 2013 18:24
-
-
Save danveloper/5672527 to your computer and use it in GitHub Desktop.
Redefining Further - "Redefining the Service Layer with Groovy Categories"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LocalPaymentService implements PaymentService { | |
public String process(PaymentType paymentType) { | |
if (paymentType instanceof CreditCardPaymentType) { | |
use (CreditCardPaymentProcessor) { | |
return paymentType.process() | |
} | |
} | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment