473,327 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Object Oriented approach to receiving messages

Hi,

I come from a C background. I am trying to receive messages over a serial
port. The message data structure format is along the lines of

int message_id;
int message_length;
int data[message_length];

There will be different messages received with different IDs and variable
lengths.

If I were to write this in C I would use something like:-
switch (message_id){
case 1:
decode_message();
add_to_msg_processing_queue();
break;
....
}

There will also be a transmit routine to write too.

Now I don't feel that this is very good object oriented approach. Could
anyone suggest a better way to handle this type of message structure in C#?

Thanks
Nov 17 '05 #1
0 858

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: flamesrock | last post by:
ok, so to my knowledge, object oriented means splitting something into the simplest number of parts and going from there. But the question is- when is it enough? For example I have the following...
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
2
by: Krimgelas | last post by:
Hello, I have been programming in PHP for a while, but always the classic function oriented approach. I would like to learn how to program in PHP with an object oriented approach, but so far...
2
by: lpw | last post by:
I have dilligently reviewed FAQ-lite Section 3.2, "How do I pass a pointer-to-member-function to a signal handler, X event callback, system call that starts a thread/task, etc." The only...
8
by: Brian | last post by:
Hi, I come from a C background. I am trying to receive messages over a serial port. The message data structure format is along the lines of int message_id; int message_length; int data; ...
73
by: Water Cooler v2 | last post by:
I am new to PHP, just one day new. But I am otherwise a seasoned programmer on many other languages like C, VB 6, C#, VB.NET, Win32 platform and have some tiny bit experience in MFC, C++, Python. ...
47
by: Thierry Chappuis | last post by:
Hi, I'm interested in techniques used to program in an object-oriented way using the C ANSI language. I'm studying the GObject library and Laurent Deniau's OOPC framework published on his web...
46
by: ajba74 | last post by:
Hi fellows, I am reading some books to learn the C programming language, and sometimes I have the feeling that when somebody becomes a C expert, he must learn a more modern and object-oriented...
5
by: Marijn | last post by:
Hello everybody, I am new to PHP and working on extending my knowledge of OOP. The posts in this group concerned with whether or not to use an OO approach when programming in PHP is not what I...
3
by: notnorwegian | last post by:
i have some confusion over this. sure a class is basically a classification, like for example an animal or flower. and an object/instance of that class is then for example a cat. an object is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.