Usually protocol stack or message based softwares are designed/implemented in terms of states, events and rules set by protocol or requirements.
Here I propose a different approach:
Instead of separating components of software or layers of protocol stack and implementing them independently in terms of states/events, we can actually go for "Tag" based approach.
Protocol message contain tags (separate tags or tags inside tags). These Tags can have "Handler(s)" and "Interpreters(s)". Interpreters would go into specifics of protocol like byte format, byte structure, actual bit/byte value & its conversion to enumerated value etc. What comes out of Handlers (and tracked by framework) forms the basis on which Handlers will work. Handlers - given control after Interpreters - will actually implement rules set by protocol/requirements. Handlers in turn will call "Out-Interpreters" who in turn takes care of encoding of response messages.
As I have worked out further intricacies of this approach, with underlying framework same and possibly reusing handlers/interpreters, both network and subscriber elements can be implemented beautifully. Though initial framework implementation effort is considerably more, once that is perfected, development of interpreters/handlers would be smooth. Also design being robust, maintenance/enhancement effort would be predictable and eventually straightforward in nature.
The idea need to be further analysed !
© Copyright Samir Amberkar 2010