Last active
August 29, 2015 14:20
-
-
Save vackosar/486e2b6b437f73abfe39 to your computer and use it in GitHub Desktop.
DSL vs XML configuration
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
DSL configuration has all relevant information colocated on one place in the code. | |
XML configuration has information scattered. Part is in the XML and part in the code. | |
DSL CONFIGURATION EXAMPLE | |
.<OrderItem, Boolean>route(OrderItem::isIced, mapping -> mapping // 16 | |
.subFlowMapping("true", routeIced())// 24 | |
.subFlowMapping("false", routeNotIced())) | |
XML CONFIGURATION EXAMPLE | |
<int:router input-channel="drinks" ref="drinkRouter" method="resolveOrderItemChannel"/> | |
--- | |
public class DrinkRouter { | |
public String resolveOrderItemChannel(OrderItem orderItem) { | |
return (orderItem.isIced()) ? "coldDrinks" : "hotDrinks"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment