Unrelevant legacy aggregates

49 views
Skip to first unread message

Alexandre Potvin Latreille

unread,
Sep 17, 2016, 5:25:39 PM9/17/16
to DDD/CQRS
I have a system that sends out reminders. The reminding template is identical for reminders that are sharing some criteria's so a single notification (email in this case) may be sent out to cover multiple reminders at a time. I have an aggregate that represents that grouping (we haven't found a good name yet, but let it be called a DeliveryPolicy) that has an associated scope (e.g. a specific month). A DeliveryPolicy is responsible for achieving the delivery of reminders that falls under it's scope and guarantees that only one email will be sent out to each email address, independently of how many reminders had that same email address within that scope. In other words, if multiple reminders are to be sent to the same email address within that scope then one and only one should be sent out to that address.

Simplified anatomy of a reminder: { organizationName, emailAddress, month }

Now, the DeliveryPolicy aggregate will only be useful as long as different reminders can share the same reminding template, but eventually we may want a different reminding template for every reminder and send a different email for every  reminder. In that case the DeliveryPolicy aggregate wouldn't be useful anymore.

How shall we evolve the code at that point? Should we delete the DeliveryPolicy aggregate class? Keep it around and mark it deprecated? What about the event classes? Shall we keep them around? A DeliveryPolicy will never have to process any further commands. I actually never really bothered myself with that question before and the code base always reflected the current business problem, but somehow I'm now wondering if I'm right to do so because I'd have data which cannot be expressed by the model anymore.


Reply all
Reply to author
Forward
0 new messages