|
38 | 38 |
|
39 | 39 | /** |
40 | 40 | * |
41 | | - * Example application demonstrating Hexagonal Architecture |
| 41 | + * Hexagonal Architecture pattern decouples the application core from the |
| 42 | + * services it uses. This allows the services to be plugged in and the |
| 43 | + * application will run with or without the services.<p> |
| 44 | + * |
| 45 | + * The core logic, or business logic, of an application consists of the |
| 46 | + * algorithms that are essential to its purpose. They implement the use |
| 47 | + * cases that are the heart of the application. When you change them, you |
| 48 | + * change the essence of the application.<p> |
| 49 | + * |
| 50 | + * The services are not essential. They can be replaced without changing |
| 51 | + * the purpose of the application. Examples: database access and other |
| 52 | + * types of storage, user interface components, e-mail and other |
| 53 | + * communication components, hardware devices.<p> |
| 54 | + * |
| 55 | + * This example demonstrates Hexagonal Architecture with a lottery system. |
| 56 | + * The application core is separate from the services that drive it and |
| 57 | + * from the services it uses.<p> |
| 58 | + * |
| 59 | + * The primary ports for the application are {@link LotteryAdministration} |
| 60 | + * through which the lottery round is initiated and run and |
| 61 | + * {@link LotteryService} that allows players to submit lottery tickets for |
| 62 | + * the draw.<p> |
| 63 | + * |
| 64 | + * The secondary ports that application core uses are {@link WireTransfers} |
| 65 | + * which is a banking service, {@link LotteryNotifications} that delivers |
| 66 | + * notifications as lottery events occur and {@link LotteryTicketRepository} |
| 67 | + * that is the storage for the lottery tickets. |
42 | 68 | * |
43 | 69 | */ |
44 | 70 | public class App { |
|
0 commit comments