Jump to content

LapDog & Variant Messages Question


Recommended Posts

A while back James posted this question.

Question: Why don't you have a "VariantMessage" Type?

So...

I'm working on an update for LapDog.Messaging. Among other things, the update adds a library of native array types. I'm strongly considering adding a VariantMessage based on James' arguments on that thread. My question...

Is there sufficient value in having a VariantArrayMsg included in the array message library to justify the additional overhead? I prefer to keep the library reasonably small so projects don't get bogged down with lots of unused classes, and an array of variants can just be stuffed inside a regular VariantMessage so I'm not seeing a lot of value in a VariantArrayMsg. Thoughts?

Link to comment

Having not used LapDog (and not much intention in the near future), I'd still agree that VariantArrayMsg seems unnecessary. There are few use cases where you're "doing it right" if you have to do that, I think, and is a corner case that, like you said, can be covered by the VariantMsg.

Link to comment

I would say “no”, as generally one could choose to either use variant messages or a long list of specific-type messages. Array of Variants is kind of a mix of both.

— James

Aside: After our previous conversation, I actually modified my own message hierarchy by eliminating all simple-type messages in favor of VariantMessages, except where there was extra functionality involved (for example: ErrorMessage). And in actual use, I tend to either use completely generic messages (Variant) or create specific-purpose messages for specific uses. The latter can have multiple data elements and are usually used in the “Command Pattern” (i.e. they have “Execute" or “Do" methods rather than “Read”).

Thank you for considering VariantMessage for LapDog, BTW. I have recently been doing consulting work where I can't use my own messaging package, so I’m interested in Lapdog being widely adopted and as flexible as possible.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.