Modeling the domain in terms of messaging protocols

24 views
Skip to first unread message

Damian Płaza

unread,
Jul 8, 2024, 4:44:56 PMJul 8
to Growing Object-Oriented Software
Hi!

In this thread: https://groups.google.com/g/growing-object-oriented-software/c/S--1GnVuVEM/m/IHvzDidxyMoJ , Nat mentioned the following design approach:

> Maybe it's because I model the domain in terms of messaging protocols, not classes, and define roles that objects play from the needs of the client.  When I find that a client needs services from another object, I'll introduce a new role or use an existing role.  As it needs new services, I'll either add those to existing roles (if it makes sense) or define new roles, to be played by new objects.  So if I find an SRP violation it's not when a *class* gets too big, but when a new message doesn't match an existing role.

1. "model the domain in terms of messaging protocols (...)"
  • What does it mean, in simple terms?
  • Taking into account "modern" DDD-omnipresence, how different is such approach in comparison to Evans' approach?
2. "So if I find an SRP violation it's not when a *class* gets too big, but when a new message doesn't match an existing role"
  • What does "doesn't match an existing role" mean in this context? 
    • Does it mean that an existing role "does too much" so it needs to be divided into two roles?
    • A new message (a responsibility?) doesn't fit the existing role?
Thanks a lot for great insights!
Reply all
Reply to author
Forward
0 new messages