Quantcast
Viewing all articles
Browse latest Browse all 2703

Communication between modules based on XML messages

Hello guys!

At work I was able to join the team that creates quite a large and complicated system. Before implementation, I would like to have my own thoughts and a little more understanding of the subject.

Could you read few questions ?

1 )

I have to create a module which can communicate with that system, and perform some necessary actions. Whole communication between system and all modules are based on XML messages, which can have very different forms ( only header is constant ). The simplest message can be XML with one node, while another could have three of them . What do you think about it ? Could you guide me, how to parse those messages in the most elegant way ? Maybe I should try to keep some templates of those messages in external files?

2 )

The system gives the ability to listen for new messages, receive and interpret them. Here comes the next question about architecture. In this case we have to create an additional thread that will only listen to the "mailbox", and if a message was detected it will pass it to the main thread where it can be interpreted. Do you think it’s a good idea ?

3 )

The last thing I would like to ask you guys, is application architecture where the action is based on the “question / answer” ? Give me a second and I will explain myself : Before module can perform any action, it has to communicate with the system. Please, check the “chip” example ;- )

Module: Can I go home ?
System: Yes, you can
Module: Then please give me the keys
System: Here you are
Module: Thanks, got them!

So to take any action, you must first speak a little with a system. I don’t have any clue, how to implement this in right way. Maybe some kind of machine state ?

I don’t ask for any code, but for guide so I can implement this with my own power :D

So, Please. Could you give me your wise hand ? :- ))

Viewing all articles
Browse latest Browse all 2703

Trending Articles