This file contains hidden or 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
//regular customer | |
class Customer { | |
private String name; | |
String getName() { | |
return name; | |
} | |
boolean canCancelDispatchedOrder() { | |
return false; | |
} | |
} |
This file contains hidden or 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
//domain | |
package com.company.bigproject.domain; | |
//or just | |
package com.company.bigproject; | |
//[...] | |
//presentation | |
package com.company.bigproject.web; | |
//[...] |
This file contains hidden or 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 Customer { | |
String name; | |
} | |
class Item { | |
String sku; | |
BigDecimal price; | |
} | |
class Order { |
This file contains hidden or 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
//regular customer | |
class Customer { | |
private String name; | |
String getName() { | |
return name; | |
} | |
boolean canCancelDispatchedOrder() { | |
return false; | |
} | |
} |
This file contains hidden or 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 Order { | |
Item[] items; | |
String orderId; | |
Customer customer; | |
Double totalPrice; | |
void addItem(Item item) { | |
//... | |
totalPrice = null; | |
} |
This file contains hidden or 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 Order { | |
Item[] items; | |
String orderId; | |
Customer customer; | |
void addItem(Item item) { | |
} | |
double getTotalPrice() { | |
//... |
This file contains hidden or 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 ShopSellerService { | |
@Inject | |
@SMS | |
private Notifier notifier; | |
public void sell(Order order) { | |
order.toPlaced(); | |
notifier.sendOrderPlacedNotification(order.getCustomer()); |
This file contains hidden or 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 OrderPlacedEvent { | |
private Order order; | |
} | |
class ShopSellerService { | |
@Inject | |
private EventBus eventBus; | |
public void sell(Order order) { |
This file contains hidden or 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 OrderPlacedEvent { | |
private Order order; | |
} | |
class ShopSellerService { | |
@Inject | |
private EventBus eventBus; | |
public void sell(Order order) { |
This file contains hidden or 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 OrderPlacedEvent { | |
private Order order; | |
} | |
class ShopSellerService { | |
@Inject | |
private EventBus eventBus; | |
public void sell(Order order) { |