From: Simon Wright <simon@pushface.org>
Subject: Re: OO problem: Performing actions on messages (very long, sorry)
Date: 10 Jan 2005 21:54:48 +0000
Date: 2005-01-10T21:54:48+00:00 [thread overview]
Message-ID: <x7voefx6jbr.fsf@smaug.pushface.org> (raw)
In-Reply-To: 1103723394.299024.314670@c13g2000cwb.googlegroups.com
"per" <commander@death-star.com> writes:
> I'm new to Ada (but not to OO). I'm having trouble designing a
> system, or at least a key part of it. (I have a few alternative
> non-tested solutions but I don't get why this doesn't work.) And I'd
> like to do it "by the book" in nice OO Ada coding style.
Nothing wrong with that, but you do need to get the right classes
(analyse the right problem? -- UML background coming out there!).
Seems to me you have a number of message specs; a message spec
consists of a (ordered) set of field specs; a field spec consists of a
type (and perhaps a size). It's here that you're going to hit "simple"
Ada types.
I'm not sure where your actions come in; are they related to a field
type, to a field in a message type, or a field in a particular
message?
Anyway, given a set of field specs in a message spec you can build up
a particular message (consisting of field _values_ corresponding to
the specs). And the action can do its thing when appropriate,
The message would (in my view) have a lot more to it than the bare
bytes that get sent to the equipment under test (I suspect you think
so too). What might be appropriate here is a convert-to-byte-stream
operation.
The advantage of a data-driven approach like this, if you can swing
it, is that adding new messages is only a matter of adding new message
type definitions, which are just data about messages.
Just my 2p --
prev parent reply other threads:[~2005-01-10 21:54 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-22 13:49 OO problem: Performing actions on messages (very long, sorry) per
2004-12-22 15:17 ` Dmitry A. Kazakov
2004-12-22 16:28 ` Martin Krischik
2004-12-22 17:42 ` per
2004-12-22 18:16 ` Martin Krischik
2004-12-22 19:54 ` Dmitry A. Kazakov
2005-01-03 12:37 ` per
2005-01-03 14:14 ` Dmitry A. Kazakov
2005-01-04 12:05 ` per
2005-01-04 13:30 ` Dmitry A. Kazakov
2005-01-04 15:21 ` per
2005-01-04 17:47 ` Dmitry A. Kazakov
2005-01-05 12:01 ` per
2005-01-05 13:23 ` Dmitry A. Kazakov
2005-01-05 15:59 ` per
2005-01-05 20:44 ` Dmitry A. Kazakov
2005-01-10 8:42 ` per
2005-01-10 14:22 ` Dmitry A. Kazakov
2005-01-10 16:24 ` per
2005-01-10 19:09 ` Dmitry A. Kazakov
2005-01-11 9:06 ` per
2004-12-22 17:46 ` per
2004-12-22 18:02 ` Martin Krischik
2005-01-03 10:05 ` per
2004-12-22 18:35 ` u_int32_t
2004-12-22 18:38 ` u_int32_t
2004-12-24 18:52 ` Nick Roberts
2005-01-03 16:59 ` per
2005-01-10 12:10 ` per
2005-01-10 13:49 ` Marius Amado Alves
2005-01-10 21:54 ` Simon Wright [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox