-
-
Notifications
You must be signed in to change notification settings - Fork 81
/
Copy pathLakesideMutual.cml
678 lines (605 loc) · 22.5 KB
/
LakesideMutual.cml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
/**
* A reverse engineered (https://github.com/ContextMapper/context-map-discovery)
* and manually adjusted Context Map of the Lakeside Mutual microservice project:
* https://github.com/Microservice-API-Patterns/LakesideMutual
*
* Note: The discovery library currently one detects the Upstream-Downstream
* relationships without additional patterns such as OHS, PL, ect.
* These patterns are manually added here:
*/
ContextMap LakesideMutual {
contains CustomerCore, CustomerManagement, CustomerSelfService
contains PolicyManagement, ClaimsManagement
CustomerCore [OHS, PL]-> CustomerManagement {
exposedAggregates cities, CustomerCore_customers
}
CustomerCore [OHS, PL]->[CF] CustomerSelfService {
exposedAggregates cities, CustomerCore_customers
}
CustomerCore [OHS, PL]->[ACL] PolicyManagement {
exposedAggregates cities, CustomerCore_customers
}
PolicyManagement -> CustomerSelfService {
exposedAggregates insurance_quote_requests, customers, riskfactor, policies
}
CustomerCore [OHS, PL]-> ClaimsManagement {
exposedAggregates CustomerCore_customers
}
PolicyManagement -> ClaimsManagement {
exposedAggregates policies, riskfactor
}
ClaimsManagement -> CustomerSelfService {
exposedAggregates Claims, Payment, Notification
}
}
/**
* The 'Claims Management' context below is a result of our Event Storming for the new
* claim processing feature. See ./images/claim-processing-event-storming-result.jpg.
*
* Issue: We currently modeled the feature within a new Bounded Context, although it
* would also be possible to implement it as part of the Policy Management Context.
*/
BoundedContext ClaimsManagement implements ClaimsManagement {
type FEATURE
domainVisionStatement "This Bounded Context manages the processing of claims ..."
Aggregate ClaimSelfService {
Entity ClaimSubmission {
aggregateRoot
SelfServicePortalUser user
- Claim claim
}
"role: Customer"
CommandEvent SubmitClaim
DomainEvent ClaimSubmitted // triggers CheckClaimDocumentation command
}
Aggregate Claims {
Entity Claim {
aggregateRoot
long claimId
- CustomerId customer
String ^description
Blob requestDocument
boolean isComplete
boolean isAssessed
- ClaimState claimState
}
enum ClaimState {
OPEN, REJECTED, ACCEPTED
}
abstract DomainEvent AbstractClaimEvent {
Date timestamp
- Claim claim
}
abstract CommandEvent AbstractClaimCommand {
- Claim claim
}
"role: Administrator in charge"
CommandEvent CheckClaimDocumentation extends @AbstractClaimCommand
DomainEvent ClaimRegistered extends @AbstractClaimEvent // triggers CheckInsurance command
"role: Responsible person in claims department"
CommandEvent CheckInsurance extends @AbstractClaimCommand {
- Set<PolicyId> policies
}
DomainEvent AssessmentPerformed extends @AbstractClaimEvent // triggers AcceptClaim or RejectClaim command depending on result
"role: Responsible person in claims department"
CommandEvent AcceptClaim extends @AbstractClaimCommand
DomainEvent ClaimAccepted extends @AbstractClaimEvent // triggers SchedulePayment command
"role: Responsible person in claims department"
CommandEvent RejectClaim extends @AbstractClaimCommand
DomainEvent ClaimRejected extends @AbstractClaimEvent // triggers NofifyCustomer command
Service ClaimService {
@ClaimRegistered checkDocumentation(@CheckClaimDocumentation cmd);
@AssessmentPerformed checkInsurance(@CheckInsurance cmd);
@ClaimAccepted acceptClaim(@AcceptClaim cmd);
@ClaimRejected rejectClaim(@RejectClaim commandcal);
}
}
Aggregate Payment {
Entity Payment {
aggregateRoot
- Claim claim
- PaymentState paymentState
}
enum PaymentState {
SCHEDULED, PERFORMED
}
abstract CommandEvent AbstractNotificationCommand {
- Payment payment
}
abstract DomainEvent AbstractNotificationEvent {
Date timestamp
- Payment payment
}
CommandEvent SchedulePayment extends @AbstractNotificationCommand
DomainEvent PaymentScheduled extends @AbstractNotificationEvent // triggers PerformPayment command
CommandEvent PerformPayment extends @AbstractNotificationCommand
DomainEvent PaymentPerformed extends @AbstractNotificationEvent // triggers NofifyCustomer command
Service PaymentService {
@PaymentScheduled schedulePayment(@SchedulePayment cmd);
@PaymentPerformed performPayment(@PerformPayment cmd);
}
}
Aggregate Notification {
Entity Notification {
aggregateRoot
- Claim claim
}
CommandEvent NofifyCustomer
DomainEvent CustomerNotified {
Date timestamp
}
Service NotificationService {
@CustomerNotified notifyCustomer(@NofifyCustomer cmd);
}
}
}
/**
* The following Bounded Contexts are reverse engineered with our discovery library
* (https://github.com/ContextMapper/context-map-discovery):
*/
BoundedContext PolicyManagement implements PolicyManagement {
type FEATURE
implementationTechnology "Spring Boot"
// This Aggregate has been created on the basis of the RESTful HTTP controller com.lakesidemutual.policymanagement.interfaces.InsuranceQuoteRequestInformationHolder.
Aggregate insurance_quote_requests {
// This value object has been derived from the class com.lakesidemutual.policymanagement.interfaces.dtos.insurancequoterequest.InsuranceQuoteRequestDto.
ValueObject InsuranceQuoteRequestDto {
List<RequestStatusChangeDto> statusHistory
String policyId
InsuranceOptionsDto insuranceOptions
CustomerInfoDto customerInfo
Long id
InsuranceQuoteDto insuranceQuote
Date date
}
Entity insurance_quote_requests_RootEntity {
aggregateRoot
* List<@InsuranceQuoteRequestDto> getInsuranceQuoteRequests;
* @InsuranceQuoteRequestDto getInsuranceQuoteRequest;
}
}
// This Aggregate has been created on the basis of the RESTful HTTP controller com.lakesidemutual.policymanagement.interfaces.CustomerInformationHolder.
Aggregate customers {
// This value object has been derived from the class com.lakesidemutual.policymanagement.interfaces.dtos.customer.CustomerIdDto.
ValueObject CustomerIdDto {
String id
}
Entity customers_RootEntity {
aggregateRoot
* @CustomerDto getCustomer (@CustomerIdDto customerIdDto);
* List<@customers_PolicyDto> getPolicies (@CustomerIdDto customerIdDto);
* @PaginatedCustomerResponseDto getCustomers;
}
// This value object has been derived from the class com.lakesidemutual.policymanagement.interfaces.dtos.customer.CustomerDto.
ValueObject CustomerDto {
String customerId
CustomerProfileDto customerProfile
List<Link> links
}
// This value object has been derived from the class com.lakesidemutual.policymanagement.interfaces.dtos.policy.PolicyDto.
ValueObject customers_PolicyDto {
Object customer
Date creationDate
String policyType
InsuringAgreementDto insuringAgreement
MoneyAmountDto insurancePremium
List<Link> links
MoneyAmountDto policyLimit
PolicyPeriodDto policyPeriod
String policyId
MoneyAmountDto deductible
List<String> expandable
}
// This value object has been derived from the class com.lakesidemutual.policymanagement.interfaces.dtos.customer.PaginatedCustomerResponseDto.
ValueObject PaginatedCustomerResponseDto {
int offset
int ^size
String filter
int limit
List<Link> links
- List<CustomerDto> customers
}
}
// This Aggregate has been created on the basis of the RESTful HTTP controller com.lakesidemutual.policymanagement.interfaces.RiskComputationService.
Aggregate riskfactor {
Entity riskfactor_RootEntity {
aggregateRoot
}
}
// This Aggregate has been created on the basis of the RESTful HTTP controller com.lakesidemutual.policymanagement.interfaces.PolicyInformationHolder.
Aggregate policies {
// This value object has been derived from the class com.lakesidemutual.policymanagement.interfaces.dtos.policy.PolicyDto.
ValueObject PolicyDto {
MoneyAmountDto insurancePremium
List<String> expandable
String policyId
String policyType
MoneyAmountDto deductible
List<Link> links
MoneyAmountDto policyLimit
PolicyPeriodDto policyPeriod
InsuringAgreementDto insuringAgreement
Date creationDate
Object customer
}
// This value object has been derived from the class com.lakesidemutual.policymanagement.interfaces.dtos.policy.CreatePolicyRequestDto.
ValueObject CreatePolicyRequestDto {
MoneyAmountDto insurancePremium
InsuringAgreementDto insuringAgreement
MoneyAmountDto policyLimit
PolicyPeriodDto policyPeriod
String customerId
String policyType
MoneyAmountDto deductible
}
Entity policies_RootEntity {
aggregateRoot
* @PolicyDto getPolicy (@PolicyId policyId);
* @PolicyDto updatePolicy (@CreatePolicyRequestDto createPolicyDto, @PolicyId policyId);
* @PaginatedPolicyResponseDto getPolicies;
}
// This value object has been derived from the class com.lakesidemutual.policymanagement.interfaces.dtos.policy.PaginatedPolicyResponseDto.
ValueObject PaginatedPolicyResponseDto {
int limit
List<Link> links
int offset
int ^size
- List<PolicyDto> policies
}
// This value object has been derived from the class com.lakesidemutual.policymanagement.domain.policy.PolicyId.
ValueObject PolicyId {
long serialVersionUID
String id
}
}
}
BoundedContext CustomerManagement implements CustomerManagement {
type FEATURE
implementationTechnology "Spring Boot"
// This Aggregate has been created on the basis of the RESTful HTTP controller com.lakesidemutual.customermanagement.interfaces.CustomerInformationHolder.
Aggregate CustomerManagement_customers {
// This value object has been derived from the class com.lakesidemutual.customermanagement.interfaces.dtos.PaginatedCustomerResponseDto.
ValueObject CustomerManagement_customers_PaginatedCustomerResponseDto {
String filter
int ^size
int offset
List<Link> links
int limit
- List<CustomerManagement_customers_CustomerDto> customers
}
// This value object has been derived from the class com.lakesidemutual.customermanagement.interfaces.dtos.CustomerDto.
ValueObject CustomerManagement_customers_CustomerDto {
List<Link> links
String customerId
- CustomerProfileDto customerProfile
}
// This value object has been derived from the class com.lakesidemutual.customermanagement.interfaces.dtos.CustomerProfileDto.
ValueObject CustomerProfileDto {
List<AddressDto> moveHistory
String firstname
String phoneNumber
Date birthday
String lastname
String ^email
AddressDto currentAddress
}
Entity CustomerManagement_customers_RootEntity {
aggregateRoot
* @CustomerManagement_customers_PaginatedCustomerResponseDto getCustomers;
* @CustomerManagement_customers_CustomerDto getCustomer (@CustomerManagement_customers_CustomerId customerId);
* @CustomerManagement_customers_CustomerDto updateCustomer (@CustomerManagement_customers_CustomerId customerId, @CustomerProfileDto customerProfile);
}
// This value object has been derived from the class com.lakesidemutual.customermanagement.domain.customer.CustomerId.
ValueObject CustomerManagement_customers_CustomerId {
long serialVersionUID
String id
}
}
// This Aggregate has been created on the basis of the RESTful HTTP controller com.lakesidemutual.customermanagement.interfaces.NotificationInformationHolder.
Aggregate notifications {
Entity notifications_RootEntity {
aggregateRoot
* List<@NotificationDto> getNotifications;
}
// This value object has been derived from the class com.lakesidemutual.customermanagement.interfaces.dtos.NotificationDto.
ValueObject NotificationDto {
int count
String customerId
String username
}
}
// This Aggregate has been created on the basis of the RESTful HTTP controller com.lakesidemutual.customermanagement.interfaces.InteractionLogInformationHolder.
Aggregate interaction_logs {
// This value object has been derived from the class com.lakesidemutual.customermanagement.domain.customer.CustomerId.
ValueObject interaction_logs_CustomerId {
long serialVersionUID
String id
}
// This value object has been derived from the class com.lakesidemutual.customermanagement.domain.interactionlog.InteractionLogAggregateRoot.
ValueObject InteractionLogAggregateRoot {
String customerId
String lastAcknowledgedInteractionId
String username
Collection<InteractionEntity> ^interactions
}
Entity interaction_logs_RootEntity {
aggregateRoot
* @InteractionLogAggregateRoot getInteractionLog (@interaction_logs_CustomerId customerId);
}
}
}
BoundedContext CustomerSelfService implements SelfService {
type FEATURE
implementationTechnology "Spring Boot"
// This Aggregate has been created on the basis of the RESTful HTTP controller com.lakesidemutual.customerselfservice.interfaces.AuthenticationController.
Aggregate auth {
Entity auth_RootEntity {
aggregateRoot
}
}
// This Aggregate has been created on the basis of the RESTful HTTP controller com.lakesidemutual.customerselfservice.interfaces.InsuranceQuoteRequestInformationHolder.
Aggregate CustomerSelfService_insurance_quote_requests {
// This value object has been derived from the class com.lakesidemutual.customerselfservice.interfaces.dtos.insurancequoterequest.InsuranceQuoteRequestDto.
ValueObject CustomerSelfService_insurance_quote_requests_InsuranceQuoteRequestDto {
List<RequestStatusChangeDto> statusHistory
Long id
Date date
InsuranceQuoteDto insuranceQuote
InsuranceOptionsDto insuranceOptions
CustomerInfoDto customerInfo
String policyId
}
Entity CustomerSelfService_insurance_quote_requests_RootEntity {
aggregateRoot
* @CustomerSelfService_insurance_quote_requests_InsuranceQuoteRequestDto getInsuranceQuoteRequest;
* List<@CustomerSelfService_insurance_quote_requests_InsuranceQuoteRequestDto> getInsuranceQuoteRequests;
}
}
// This Aggregate has been created on the basis of the RESTful HTTP controller com.lakesidemutual.customerselfservice.interfaces.CityStaticDataHolder.
Aggregate CustomerSelfService_cities {
// This value object has been derived from the class com.lakesidemutual.customerselfservice.interfaces.dtos.city.CitiesResponseDto.
ValueObject CustomerSelfService_cities_CitiesResponseDto {
List<String> cities
}
Entity CustomerSelfService_cities_RootEntity {
aggregateRoot
* @CustomerSelfService_cities_CitiesResponseDto getCitiesForPostalCode;
}
}
// This Aggregate has been created on the basis of the RESTful HTTP controller com.lakesidemutual.customerselfservice.interfaces.UserInformationHolder.
Aggregate user {
Entity user_RootEntity {
aggregateRoot
* @UserResponseDto getCurrentUser;
}
// This value object has been derived from the class com.lakesidemutual.customerselfservice.interfaces.dtos.identityaccess.UserResponseDto.
ValueObject UserResponseDto {
String ^email
String customerId
}
}
// This Aggregate has been created on the basis of the RESTful HTTP controller com.lakesidemutual.customerselfservice.interfaces.CustomerInformationHolder.
Aggregate CustomerSelfService_customers {
// This value object has been derived from the class com.lakesidemutual.customerselfservice.interfaces.dtos.insurancequoterequest.InsuranceQuoteRequestDto.
ValueObject CustomerSelfService_customers_InsuranceQuoteRequestDto {
String policyId
List<RequestStatusChangeDto> statusHistory
CustomerInfoDto customerInfo
InsuranceOptionsDto insuranceOptions
Long id
InsuranceQuoteDto insuranceQuote
Date date
}
// This value object has been derived from the class com.lakesidemutual.customerselfservice.interfaces.dtos.customer.CustomerDto.
ValueObject CustomerSelfService_customers_CustomerDto {
String customerId
List<Link> links
CustomerProfileDto customerProfile
}
// This value object has been derived from the class com.lakesidemutual.customerselfservice.domain.customer.CustomerId.
ValueObject CustomerSelfService_customers_CustomerId {
String id
long serialVersionUID
}
Entity CustomerSelfService_customers_RootEntity {
aggregateRoot
* @CustomerSelfService_customers_AddressDto changeAddress (@CustomerSelfService_customers_CustomerId customerId, @CustomerSelfService_customers_AddressDto requestDto);
* @CustomerSelfService_customers_CustomerDto getCustomer (@CustomerSelfService_customers_CustomerId customerId);
* List<@CustomerSelfService_customers_InsuranceQuoteRequestDto> getInsuranceQuoteRequests (@CustomerSelfService_customers_CustomerId customerId);
}
// This value object has been derived from the class com.lakesidemutual.customerselfservice.interfaces.dtos.customer.AddressDto.
ValueObject CustomerSelfService_customers_AddressDto {
String streetAddress
String city
String postalCode
}
}
}
BoundedContext CustomerCore implements CustomerManagement {
type FEATURE
implementationTechnology "Spring Boot"
// This Aggregate has been created on the basis of the RESTful HTTP controller com.lakesidemutual.customercore.interfaces.CityStaticDataHolder.
Aggregate cities {
Entity cities_RootEntity {
aggregateRoot
* @CitiesResponseDto getCitiesForPostalCode;
}
// This value object has been derived from the class com.lakesidemutual.customercore.interfaces.dtos.city.CitiesResponseDto.
ValueObject CitiesResponseDto {
List<String> cities
}
}
// This Aggregate has been created on the basis of the RESTful HTTP controller com.lakesidemutual.customercore.interfaces.CustomerInformationHolder.
Aggregate CustomerCore_customers {
// This value object has been derived from the class com.lakesidemutual.customercore.interfaces.dtos.customer.AddressDto.
ValueObject AddressDto {
String streetAddress
String city
String postalCode
}
// This value object has been derived from the class com.lakesidemutual.customercore.domain.customer.CustomerId.
ValueObject CustomerId {
String id
long serialVersionUID
}
Entity CustomerCore_customers_RootEntity {
aggregateRoot
* @CustomerResponseDto updateCustomer (@CustomerProfileUpdateRequestDto requestDto, @CustomerId customerId);
* @CustomersResponseDto getCustomer;
* @AddressDto changeAddress (@CustomerId customerId, @AddressDto requestDto);
* @CustomerCore_customers_PaginatedCustomerResponseDto getCustomers;
}
// This value object has been derived from the class com.lakesidemutual.customercore.interfaces.dtos.customer.CustomerProfileUpdateRequestDto.
ValueObject CustomerProfileUpdateRequestDto {
String lastname
Date birthday
String phoneNumber
String streetAddress
String city
String ^email
String postalCode
String firstname
}
// This value object has been derived from the class com.lakesidemutual.customercore.interfaces.dtos.customer.CustomerResponseDto.
ValueObject CustomerResponseDto {
String phoneNumber
String lastname
String streetAddress
Collection<Address> moveHistory
String firstname
String ^email
String city
String postalCode
Date birthday
String customerId
List<Link> links
}
// This value object has been derived from the class com.lakesidemutual.customercore.interfaces.dtos.customer.CustomersResponseDto.
ValueObject CustomersResponseDto {
List<Link> links
- List<CustomerResponseDto> customers
}
// This value object has been derived from the class com.lakesidemutual.customercore.interfaces.dtos.customer.PaginatedCustomerResponseDto.
ValueObject CustomerCore_customers_PaginatedCustomerResponseDto {
List<Link> links
String filter
int limit
int offset
int ^size
- List<CustomerResponseDto> customers
}
}
// our webpage content:
// https://contextmapper.org/docs/event-sourcing-and-cqrs-modeling/
Aggregate CustomerRelationshipManagement {
abstract DomainEvent AbstractDomainEvent {
Date timestamp
}
DomainEvent CustomerVerifiedEvent extends AbstractDomainEvent {
- CustomerId customer
}
DomainEvent AddressUpdatedEvent extends AbstractDomainEvent {
- CustomerId customer
- AddressDto address
}
Service AddressService {
@AddressUpdatedEvent updateAddress(@AddressDto address);
}
// CQRS Step 1:
Service CustomerService {
@CustomerId createCustomer(@CustomerDto customer);
void updateCustomer(@CustomerDto customer);
boolean deleteCustomer(@CustomerId customer);
@CustomerDto findCustomerById(@CustomerId customerId);
List<@CustomerDto> findCustomersByName(String name);
}
// CQRS Step 2:
Service CustomerCommandService1 {
@CustomerId createCustomer(@CustomerDto customer);
void updateCustomer(@CustomerDto customer);
boolean deleteCustomer(@CustomerId customer);
}
Service CustomerQueryService1 {
@CustomerDto findCustomerById(@CustomerId customerId);
List<@CustomerDto> findCustomersByName(String name);
}
CommandEvent RecordAddressChange {
-AddressDto newAddress
Date changeDate
}
}
// CQRS Step 3:
Aggregate CustomerAggregate {
ValueObject CustomerId {
UUID uniqueCustomerId
}
Entity Customer {
aggregateRoot
-CustomerId customerId
String firstName
String lastName
-List<@AddressDto> addresses
}
Entity Address // not designed in detail
Service CustomerCommandService2 {
@CustomerId createCustomer(@Customer customer);
void updateCustomer(@Customer customer);
boolean deleteCustomer(@CustomerId customer);
}
}
Aggregate CustomerReadModel {
DataTransferObject CustomerDTO {
String firstName
String lastName
}
Service CustomerQueryService2 {
@CustomerDTO findCustomerById(@CustomerId customerId);
List<@CustomerDTO> findCustomersByName(String name);
}
}
// proposal for representing slide 44 in speaker deck from MP:
// https://speakerdeck.com/mploed/event-sourcing-workshop-at-software-architecture-summit-2016?slide=44
Aggregate CQRS_CommonInfrastructure {
DomainEvent AbstractDomainEvent {
Date timestamp
}
ValueObject EventSequence {
-Set<@AbstractDomainEvent> events
}
}
Aggregate CQRS_CommandInfrastructure {
Service CommandDAO {
@EventSequence storeAndForwardEvents() publish to EventHandlerChannel;
// store in EventStore and let QueryInfrastructure know (via Handler)
}
Entity EventStore {
aggregateRoot
Repository EventStoreRepository {}
}
}
Aggregate CQRS_QueryInfrastructure {
Entity QueryDAO {
// talks to ReadStorage (BAU)
}
Entity ReadStorage {
aggregateRoot
Repository ReadStorageRepository {
subscribe to EventHandlerChannel
}
}
}
}
Domain InsuranceDomain {
Subdomain CustomerManagement {
type CORE_DOMAIN
}
Subdomain SelfService {
type SUPPORTING_DOMAIN
}
Subdomain PolicyManagement {
type CORE_DOMAIN
}
Subdomain ClaimsManagement {
type CORE_DOMAIN
}
}