Note that there are some explanatory texts on larger screens.

plurals
  1. PODesign pattern for windows service - c#
    text
    copied!<p>I am getting my feet wet with programming and my self learning brings me to this question. I have been reading about design patterns and wanted to know what a good recommendation for this would be. </p> <p>My test application sends a message to MSMQ. I want to write a windows service which will listen to this MSMQ and for every message it receives, I want it to perform a simple database insert.</p> <p>I looked at this article<a href="https://stackoverflow.com/questions/576303/message-queue-windows-service">link text</a></p> <p>which gave me some information i needed. In the example I could do most of my work within</p> <pre><code> private static void MyReceiveCompleted(Object source, ReceiveCompletedEventArgs asyncResult) { // Connect to the queue. MessageQueue mq = (MessageQueue)source; // End the asynchronous Receive operation. Message m = mq.EndReceive(asyncResult.AsyncResult); // Display message information on the screen. Console.WriteLine("Message: " + (string)m.Body); // Restart the asynchronous Receive operation. mq.BeginReceive(); return; } </code></pre> <p>But is there a specific pattern that is more viable candidate? From reading around I assume it could be the 'command' pattern but I am not sure if this is the best pattern. Any ideas or thoughts to help me get a better understanding of the patterns.</p> <p>Books I read on patterns: Head First Design patterns - i know mixed reviews on this ordered a used copy of design patterns by gang of four(sp?)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload