> My question is: is there some whitepaper, documentation, UML diagram, or
> simple source code of a well-OO-designed communication protocol framework?
>Curious... I've always thought that OOP doesn't map very well to the real
>world. The major piece of evidence for this is that almsot every text
>book example of an OO system from the 'real world' was rather stupid.
>Things like animals with rather unobvious relationships.
I got good use of the inheritance feature in one project.
A client had a MIDI-driven musical instrument with a ton of
internal state and I was writing a program to allow people
to update the state interactively via the MIDI Interface.
The MIDI spec reserves a few message types so that
manufacturers can work their unique magic. The so-called
'System Exclusive' messages are examples; a few forms of
system exclusive are standardized so you can identify a
devices manufacturer, etc.
The OOP program was a Turbo Pascal 6 app that ran on a
PC and handled the UI of the reconfiguration task. It
generated Sys.Exc. messages of the right format for the
embedded computer in the product. The classes described
below implemented device drivers generating messages to
control a device sitting on the other side of a MIDI
My inheritance hierarchy went:
- a device on a standard MIDI interface, including the
transport layer and handling of standard Sys.Exc. forms
- The client's MIDI device, including the client's chosen
Sys.Exc. format and some particular formats, e.g. to
identify the product.
- One of the client's products, including formats to
report on and to change configuration settings.
Commonly, a method was defined to return a list of the
features that could be edited.
- for each of the products, a model of that product,
using the interfaces defined above, but imposing
particular limits, such as table sizes, specific
locations for config data, etc.
Along with a factory function to make an instance
appropriate to the model of the product that was connected,
it all worked quite elegantly. The rest of the application
code was amazingly general.. GUI, text-edit boxes, and so
on; nothing to do with MIDI at all.