MSMQ – Basic Console application testing some basic functionalities

Posted by admin on July 25th, 2010

Currently I'm doing some r&d on MSMQ and how to use it in an asp.net application. I started with these two links which explain the basics of MSMQ:

I created a small .NET Console Application to test out some of the examples myself. It's basically a lot the same code (some of it is exactly the same), but it made me easily change some settings to check how they worked together. Especially transactions interested me because I'll need them for my final code in our product.

This is the source project: MSMQ Basic - TryOut

Next is the code. I added explanations in the code itself. But you really should read the MSDN documentation as it is very clear. I haven't tried out journaling yet because you need two computers to test that, so I'll do that later on @work. Next up on r&d is MSMQ support in Spring.NET and after that checking a JMS (Java Message Service) implementation (and it's integration in Spring.NET).

C#:
  1. using System;
  2. using System.Messaging;
  3. using System.Transactions;
  4.  
  5. namespace MSMQ
  6. {
  7.     /// <summary>
  8.     /// @Author: Lieven Cardoen
  9.     /// This little program tests some of the functionalities of MSMQ.
  10.     /// Sending messages synchronously and asynchronously are covered.
  11.     /// Transactions are also covered, internally by MSMQ and externally by DTC.
  12.     /// A next step would be to use some threads, but this was just some minor R&D
  13.     /// that I had to do for our product Edumatic Exam.
  14.     /// Documentation:
  15.     /// http://msdn.microsoft.com/en-us/library/ms978425.aspx
  16.     /// http://msdn.microsoft.com/en-us/library/ms978430.aspx
  17.     /// </summary>
  18.     public class MsmqTryOut
  19.     {
  20.         protected MessageQueue MessageQueue;
  21.         private const string NonTransMessageQueueName = ".\\private$\\finishedSessionsNonTrans";
  22.         private const string IntTransMessageQueueName = ".\\private$\\finishedSessionsIntTrans";
  23.         private const string ExtTransMessageQueueName = ".\\private$\\finishedSessionsExtTrans";
  24.         private const string AckQueueName = ".\\private$\\Ack";
  25.         private const string OrdersQueueName = ".\\private$\\Orders";
  26.  
  27.         /// <summary>
  28.         /// Main entry point
  29.         /// </summary>
  30.         static void Main()
  31.         {
  32.             var program = new MsmqTryOut();
  33.            
  34.         //NON TRANSACTIONAL QUEUE --> SYNC AND ASYNC MESSAGES   
  35.             program.SetUpQueue(NonTransMessageQueueName, false);
  36.             program.SendMessage(String.Format("Message sent at {0}", DateTime.Now)
  37.                 , "Non-Transactional sync message (first message)", MessageQueueTransactionType.None);
  38.             program.SendMessage(String.Format("Message sent at {0}", DateTime.Now)
  39.                 , "Non-Transactional async message (second message)", MessageQueueTransactionType.None);
  40.             /**
  41.              * Program would hang until a message is delivered (if no messages are in the queue
  42.              * and none are added anymore, program would hang forever).
  43.              * Here first message will be received
  44.              */
  45.             program.ReceiveSyncMessage(MessageQueueTransactionType.None);
  46.             /**
  47.              * Program wouldn't hang forever. Handler would be triggered when new message in queue.
  48.              * Here second message will be received. If second message is received, the queue will be deleted
  49.              * in the async handler.
  50.              */
  51.             program.ReceiveAsyncMessage();
  52.            
  53.            
  54.         //INTERNAL TRANSACTIONS (MSMQ)
  55.             program.SetUpQueue(IntTransMessageQueueName, true);
  56.             //Start the internal msmq transaction
  57.             var msgTx = new MessageQueueTransaction();
  58.             msgTx.Begin();
  59.             program.SendMessage(String.Format("Message sent at {0}", DateTime.Now), "Internal MSMQ Transactional sync Message", msgTx);
  60.             program.SendMessage(String.Format("Message sent at {0}", DateTime.Now), "Internal MSMQ Transactional sync Message", msgTx);
  61.             msgTx.Commit();
  62.  
  63.             //Start new transaction
  64.             msgTx.Begin();
  65.             program.ReceiveSyncMessage(msgTx);
  66.             program.ReceiveSyncMessage(msgTx);
  67.             Console.WriteLine("----------------------------------------------------------------------------------");
  68.             Console.WriteLine("Dispose transaction");
  69.             msgTx.Dispose();
  70.             //Two messages should still be available because previous receives were disposed
  71.             program.ReceiveSyncMessage(msgTx);
  72.             program.ReceiveAsyncMessage(); //queue will be deleted in the async handler
  73.            
  74.  
  75.         //TRANSACTIONAL QUEUE WITH EXTERNAL TRANSACTIONS (DTC)
  76.             program.SetUpQueue(ExtTransMessageQueueName, true);
  77.             //If it's a transactional queue, then Single needs to be used if the message
  78.             //isn't send in a transaction
  79.             program.SendMessage(String.Format("Message sent at {0}", DateTime.Now), "DTC Transactional sync Message", MessageQueueTransactionType.Single);
  80.             program.SendMessage(String.Format("Message sent at {0}", DateTime.Now), "DTC Transactional sync Message", MessageQueueTransactionType.Single);
  81.             using (var scope = new TransactionScope())
  82.             {
  83.                 //If a transaction is used and the queue is externally transactional (DTC),
  84.                 //then Automatic needs to be used
  85.                 program.ReceiveSyncMessage(MessageQueueTransactionType.Automatic);
  86.                 program.ReceiveSyncMessage(MessageQueueTransactionType.Automatic);
  87.                 //ReceiveAsync();   //!!! Apparently this won't be disposed. + error is thrown when async
  88.                                     //handler is triggered because the MessageQueue is already deleted.
  89.                 Console.WriteLine("----------------------------------------------------------------------------------");
  90.                 Console.WriteLine("Dispose transaction");
  91.                 scope.Dispose();
  92.             }
  93.             //Two messages should still be available
  94.             program.ReceiveSyncMessage(MessageQueueTransactionType.Single);
  95.             program.ReceiveAsyncMessage(); //queue will be deleted in the async handler
  96.  
  97.         //ACKNOWLEDGEMENTS
  98.             ReceiveAcknowledgementMessages();
  99.             DeleteQueue(OrdersQueueName);
  100.             DeleteQueue(AckQueueName);
  101.            
  102.  
  103.             //Pause the program
  104.             Console.ReadKey();
  105.         }
  106.  
  107.         /// <summary>
  108.         /// Tests acknowledgements
  109.         /// </summary>
  110.         private static void ReceiveAcknowledgementMessages()
  111.         {
  112.             Console.WriteLine("----------------------------------------------------------------------------------");
  113.             if (!MessageQueue.Exists(OrdersQueueName)) MessageQueue.Create(OrdersQueueName);
  114.             if(!MessageQueue.Exists(AckQueueName)) MessageQueue.Create(AckQueueName);
  115.             //Send Message
  116.             var msgQ = new MessageQueue(OrdersQueueName)
  117.                                     {
  118.                                         DefaultPropertiesToSend =
  119.                                             {
  120.                                                 AcknowledgeType = AcknowledgeTypes.FullReachQueue |
  121.                                                                   AcknowledgeTypes.FullReceive,
  122.                                                 AdministrationQueue = new MessageQueue(AckQueueName)
  123.                                             }
  124.                                     };
  125.             msgQ.Send("Sample");
  126.  
  127.             //Receive Message
  128.             var msg = msgQ.Receive(new TimeSpan(0), MessageQueueTransactionType.Single);
  129.             if (msg != null) Console.WriteLine("Message Received {0}", msg.Id);
  130.  
  131.             //Receive Acknowledgement Messages
  132.             var adminQ = new MessageQueue(AckQueueName)
  133.                              {
  134.                                  MessageReadPropertyFilter = {CorrelationId = true}
  135.                              };
  136.             do
  137.             {
  138.                try
  139.                {
  140.                   msg = adminQ.Receive(new TimeSpan(0,0,5));
  141.                   if (msg != null && msg.MessageType == MessageType.Acknowledgment)
  142.                      switch(msg.Acknowledgment)
  143.                      {
  144.                         case Acknowledgment.ReachQueue:
  145.                            Console.WriteLine("Message Reached Queue {0}", msg.CorrelationId);
  146.                            break;
  147.                         case Acknowledgment.Receive:
  148.                            Console.WriteLine("Message Received {0}", msg.CorrelationId);
  149.                            break;
  150.                      }
  151.                }
  152.                catch(Exception e)
  153.                {
  154.                   Console.WriteLine(e.Message);
  155.                   msg = null;
  156.                }
  157.             }
  158.             while (msg != null);
  159.         }
  160.  
  161.         /// <summary>
  162.         /// Get a message out of the queue synchronously
  163.         /// </summary>
  164.         /// <param name="messageQueueTransactionType">Type of transaction to be used</param>
  165.         private void ReceiveSyncMessage(MessageQueueTransactionType messageQueueTransactionType)
  166.         {
  167.             Console.WriteLine("----------------------------------------------------------------------------------");
  168.             var message = MessageQueue.Receive(messageQueueTransactionType);
  169.             if (message != null)
  170.             {
  171.                 message.Formatter = new XmlMessageFormatter(new[] {typeof (String)});
  172.                 var text = message.Body as String;
  173.                 var label = message.Label;
  174.                 Console.WriteLine("Received sync message (type:" + messageQueueTransactionType + ")");
  175.                 Console.WriteLine("Text:" + text);
  176.                 Console.WriteLine("Label:" + label);
  177.             }
  178.             else
  179.             {
  180.                 Console.WriteLine("ERROR: Message was null");
  181.             }
  182.         }
  183.  
  184.         /// <summary>
  185.         /// Get a message out of the queue synchronously
  186.         /// </summary>
  187.         /// <param name="mgsTx">The MessageQueueTransaction to be used</param>
  188.         private void ReceiveSyncMessage(MessageQueueTransaction mgsTx)
  189.         {
  190.             Console.WriteLine("----------------------------------------------------------------------------------");
  191.             var message = MessageQueue.Receive(mgsTx);
  192.             if (message != null)
  193.             {
  194.                 //We'll use the XmlMessageFormatter, but you could also use the binary formatter
  195.                 message.Formatter = new XmlMessageFormatter(new[] { typeof(String) });
  196.                 var text = message.Body as String;
  197.                 var label = message.Label;
  198.                 Console.WriteLine("Received sync message (type:" + mgsTx + ")");
  199.                 Console.WriteLine("Text:" + text);
  200.                 Console.WriteLine("Label:" + label);
  201.             }
  202.             else
  203.             {
  204.                 Console.WriteLine("ERROR: Message was null");
  205.             }
  206.         }
  207.  
  208.         /// <summary>
  209.         /// Get a message out of the queue asynchronously.
  210.         /// If messages are very large and network is slow for instance, then it
  211.         /// take some time to get the message. If async is used, program will not
  212.         /// hang.
  213.         /// </summary>
  214.         private void ReceiveAsyncMessage()
  215.         {
  216.             MessageQueue.ReceiveCompleted += ReceiveCompletedHandler;
  217.             MessageQueue.BeginReceive();
  218.         }
  219.  
  220.         /// <summary>
  221.         /// Asynchronous message handler
  222.         /// </summary>
  223.         /// <param name="sender">The MessageQueue</param>
  224.         /// <param name="args">Arguments (message can be accessed through the arguments</param>
  225.         private static void ReceiveCompletedHandler(Object sender, ReceiveCompletedEventArgs args)
  226.         {
  227.             Console.WriteLine("----------------------------------------------------------------------------------");
  228.             var message = args.Message;
  229.             //We'll use the XmlMessageFormatter, but you could also use the binary formatter
  230.             message.Formatter = new XmlMessageFormatter(new[] { typeof(String) });
  231.             var text = message.Body as String;
  232.             var label = message.Label;
  233.             Console.WriteLine("Received async message");
  234.             Console.WriteLine("Can be received after queue is deleted.");
  235.             Console.WriteLine("Text:" + text);
  236.             Console.WriteLine("Label:" + label);
  237.             var messageQeueue = sender as MessageQueue;
  238.  
  239.             //We delete the queue when the async message is received
  240.             //This is weird, but it makes things simple
  241.             if(messageQeueue != null) DeleteQueue(messageQeueue.Path);
  242.             else Console.WriteLine("ERROR: messageQueue was null");
  243.         }
  244.  
  245.         /// <summary>
  246.         /// Sets up the queue. If queue doesn't exist, it is created.
  247.         /// </summary>
  248.         /// <param name="messageQueueName">Name of the queue</param>
  249.         /// <param name="transactional">Boolean whether queue should be transactional or not</param>
  250.         private void SetUpQueue(string messageQueueName, bool transactional)
  251.         {
  252.             Console.WriteLine("----------------------------------------------------------------------------------");
  253.             Console.WriteLine("SetUpQueue(" + messageQueueName + Environment.NewLine + ", "
  254.                 + (transactional ? "Transactional" : "Non-Transactional") + ")");
  255.             if (!MessageQueue.Exists(messageQueueName))
  256.             {
  257.                 try
  258.                 {
  259.                     MessageQueue = MessageQueue.Create(messageQueueName, transactional);
  260.                 }
  261.                 catch (Exception createException)
  262.                 {
  263.                     //Error could occur creating queue if the code does
  264.                     //not have sufficient permissions to create queues.
  265.                     throw new Exception("Error Creating Queue", createException);   
  266.                 }
  267.             }
  268.             else
  269.             {
  270.                 try
  271.                 {
  272.                     //Warning: If existing queue has a transactional property that
  273.                     //is not equal to the transaction argument of the funtion
  274.                     //the queue should actually be recreated.
  275.                     MessageQueue = new MessageQueue(messageQueueName);
  276.                 }
  277.                 catch(Exception getException)
  278.                 {
  279.                     throw new Exception("Error Getting Queue", getException);
  280.                 }
  281.             }
  282.             //Gets or sets a value that indicates whether the message is guaranteed
  283.             //to be delivered in the event of a computer failure or network problem.
  284.             MessageQueue.DefaultPropertiesToSend.Recoverable = true;
  285.         }
  286.  
  287.         /// <summary>
  288.         /// Deletes a queue
  289.         /// </summary>
  290.         /// <param name="messageQueueName">Name of the queue</param>
  291.         private static void DeleteQueue(string messageQueueName)
  292.         {
  293.             Console.WriteLine("----------------------------------------------------------------------------------");
  294.             Console.WriteLine("DeleteQueue(" + messageQueueName + ")");
  295.             try
  296.             {
  297.                 MessageQueue.Delete(messageQueueName);
  298.             }
  299.             catch (Exception e)
  300.             {
  301.                 throw new Exception("Deletion Failed", e);
  302.             }
  303.         }
  304.  
  305.         /// <summary>
  306.         /// Sends a message to the queue
  307.         /// </summary>
  308.         /// <param name="textMessage">Text message</param>
  309.         /// <param name="label">Label of the message</param>
  310.         /// <param name="type">Type of transaction</param>
  311.         private void SendMessage(string textMessage, string label, MessageQueueTransactionType type)
  312.         {
  313.             Console.WriteLine("----------------------------------------------------------------------------------");
  314.             Console.WriteLine("SendMessage(" + textMessage + Environment.NewLine + ", " + label + ", " + type);
  315.             try
  316.             {
  317.                 var message = new Message {Body = textMessage, Recoverable = true};
  318.                 MessageQueue.Send(message, label, type);
  319.             }
  320.             catch (Exception e)
  321.             {
  322.                 throw new Exception("Error sending message to Queueu", e);
  323.             }
  324.         }
  325.  
  326.         /// <summary>
  327.         /// Sends a message to the queue
  328.         /// </summary>
  329.         /// <param name="textMessage">Text message</param>
  330.         /// <param name="label">Label of the message</param>
  331.         /// <param name="msgTx">The MessageQueueTransaction to be used</param>
  332.         private void SendMessage(string textMessage, string label, MessageQueueTransaction msgTx)
  333.         {
  334.             Console.WriteLine("----------------------------------------------------------------------------------");
  335.             Console.WriteLine("SendMessage(" + textMessage + Environment.NewLine + ", " + label + ", " + msgTx);
  336.             try
  337.             {
  338.                 var message = new Message { Body = textMessage, Recoverable = true };
  339.                 MessageQueue.Send(message, label, msgTx);
  340.             }
  341.             catch (Exception e)
  342.             {
  343.                 throw new Exception("Error sending message to Queueu", e);
  344.             }
  345.         }
  346.     }
  347. }

<

WebBrowser Control – Flash DropDown Fix (Framework 2.0)

Posted by admin on May 4th, 2010

For a customer of ours we had to create a standalone browser that could load assessments for candidates. It couldn't be loaded in a browser because the user would have access to the computer. Anyway, the .NET WebBrowser component loads a html page with the swf that starts the assessment.
The problem now was that Flex/Flash dropdowns didn't seem to work. A candidate could click on the dropdown, the items were shown but when an item was clicked, the dropdown closed and the item was not selected. On my laptop I couldn't reproduce the bug.

After searching someone pointed me in the right direction on StackOverflow and with the help of this question on a vbdotnetforum, I finally managed to find the problem and two solutions.

Problem

It seems that when clicking the dropdown, a Flash layer is displayed on top of the dropdown with the items. At that moment, the WebBrowser seems to take over the focus. When clicking on an item, you are actually clicking on the whole Flash Application, giving back focus to the swf, but not selecting an item. Because Flash gets back the focus, the dropdown closes automatically.

Solution 1

The problem only occurs when the client pc has .NET Framework 2.0 installed and nothing higher. When installing .NET Framework 2.0 SP1 or 3.5, the problem is resolved.

Solution 2

By extending the WebBrowser component and overriding one function, you can resolve the problem without upgrading .NET Framework. Use this Class as your WebBrowser and everything should work fine (the VB implementation can be found at the link above):

C#:
  1. using System.Windows.Forms;
  2.  
  3. namespace SaltoExplorer
  4. {
  5.     /// <summary>
  6.     /// When clients have .NET Framework 2.0 installed and
  7.     /// nothing higher, then there's a problem that not item
  8.     /// can be selected in Flex DropDowns.
  9.     /// It's a problem with focus. From the moment
  10.     /// .NET Framework 2.0 SP1 or  higher (like 3.5) is installed,
  11.     /// the problem is resolved.
  12.     /// Extending the WebBrowser component can fix this problem,
  13.     /// but it should only be done if the problem occurs
  14.     /// (with .NET Framework 2.0)
  15.     /// See
  16.     /// http://www.vbdotnetforums.com/vb-net-general-discussion/18563-webbrowser-control-2-0-framework-flash-fix.html
  17.     /// http://stackoverflow.com/questions/2205924/problems-flashflex-in-net-webbrowser-component
  18.     /// </summary>
  19.     public class Edumatic3WebBrowser : WebBrowser
  20.     {
  21.         private const int WmLbuttondown = 0x201;
  22.         private const int WmRbuttondown = 0x204;
  23.         private const int WmMbuttondown = 0x207;
  24.         private const int WmMouseactivate = 0x21;
  25.  
  26.         private ContainerControl FindContainerControl()
  27.         {
  28.             ContainerControl cc = null;
  29.             Control ctl = this;
  30.             while(ctl != null)
  31.             {
  32.                 var tempCc = ctl as ContainerControl;
  33.                 if(tempCc != null)
  34.                 {
  35.                     cc = tempCc;
  36.                     break;
  37.                 }
  38.                 ctl = ctl.Parent;
  39.             }
  40.             return cc;
  41.         }
  42.  
  43.         protected override void WndProc(ref Message m)
  44.         {
  45.             switch (m.Msg)
  46.             {
  47.                 case WmLbuttondown:
  48.                 case WmRbuttondown:
  49.                 case WmMbuttondown:
  50.                 case WmMouseactivate:
  51.                     if(!DesignMode)
  52.                     {
  53.                         var cc = FindContainerControl();
  54.                         if(cc != null && cc.ActiveControl != this)
  55.                         {
  56.                             //Probably giving focus to the Swf
  57.                             cc.Focus();
  58.                         }
  59.                     }
  60.                     base.DefWndProc(ref m);
  61.                     break;
  62.                 default:
  63.                     base.DefWndProc(ref m);
  64.                     break;
  65.             }
  66.         }
  67.     }
  68. }

<

Nested TransactionScopes in .NET

Posted by admin on December 7th, 2009

In next example, the persistence to the database will not be executed.

C#:
  1. IBinaryAssetStructureRepository rep = new BinaryAssetStructureRepository();
  2. var userDto = new UserDto { id = 3345 };
  3. var dto = new BinaryAssetBranchNodeDto("name", userDto, userDto);
  4. using (var scope1 = new TransactionScope())
  5. {
  6.     using (var scope2 = new TransactionScope())
  7.     {
  8.         //Persist to database
  9.         rep.CreateRoot(dto, 1, false);
  10.         scope2.Complete();
  11.     }
  12.     scope1.Dispose();
  13. }
  14. dto = rep.GetByKey(dto.id, -1, false);

scope1.Dispose(); is not necessary in this example, but I added it for clearance.

<

Getting an embedded resource out of the assembly + convert to bytearray

Posted by admin on December 7th, 2009

My file is located under /images/donkey.jpg, so in that case, don't forget to add .images.

C#:
  1. var assemblyName =  typeof(BinaryAssetFileDataProviderTest).Assembly.GetName().Name;
  2. var str = typeof (BinaryAssetFileDataProviderTest).Assembly.GetManifestResourceStream(assemblyName + ".images." + "donkey.jpg");
  3. var blob = new byte[str.Length];
  4. str.Read(blob, 0, (int)str.Length);
  5. var size = (int)str.Length;
  6. str.Close();

<

Saving a connectionString at runtime to .NET app.config

Posted by admin on December 7th, 2009
C#:
  1. var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
  2. var connectionStringSettings =
  3. new ConnectionStringSettings("ConnectionString", _arguments["connectionString"], "System.Data.SqlClient");
  4. config.ConnectionStrings.ConnectionStrings.Add(connectionStringSettings);
  5. config.Save(ConfigurationSaveMode.Modified);
  6. ConfigurationManager.RefreshSection("connectionStrings");

<

Educational software

Posted by admin on October 18th, 2009

I've been working almost 5 years now on educational software in two companies (first Indie Group, now Televic-Education). We mainly created CD-ROMS (that were enclosed with schoolbooks) and online solutions. All those applications were not built from scratch, instead we created a framework that could read in all exercises and hierarchy of the exercises. Those exercises were created in a back end were you could assemble them in folders and export them in a format for our framework (xml) or other formats like SCORM.

I haven't got any videos yet on those CD-ROMS, but you can see two of our online solutions in action. The first is Edumatic, the first application that was created and which has some 20 exercise types (multiple choice, fill in, cross word, dragndrop, translate, ...). It can be used online or exported to be used in CD-ROMS. On the site of edumatic, you can try out an online example of a multiple set of exercises (for each exercise type there are a lot of exercises). Our senior product manager (;-) Piet Santy) also shows an example each day created with Edumatic which you can follow on Twitter --> link. Please follow and try out his examples! Some of his past examples are shown here and here and here and here(demo). Edumatic back end is created in ASP.NET, the front end in Flash (AS2). Together with Christophe Herreman we created the framework for it, but a lot of other persons contributed to the framework, back end and exercise types like Kristof Neirynck(current technical lead), Bert Vandamme, Piet Santy, Sofie Deparcq and others.

Our other product, which is newer than Edumatic, is called Edumatic Exam. It is now used by three customers and has a lot of potential. It's more an assessment application than an exercise application and has currently some 15 exercise types. We are striving to support all exercise types from Edumatic, but that'll take some more time (we're nearly there). Client side is created in Flex, back end with .NET. This application is used by our government to test the knowledge of applicants. Daily there are multiple sessions with hundreds of candidates. We haven't got a demo online yet, but if you subscribe yourself at Selor, you can practice some of the language assessments with our application (you need to go to Mijn Selor, subscribe and then choose Taaloefenpakket... all in Dutch or French...) Try it out! The product is also online, but currently you can not register for it. That'll be something for the future. Currently working most on Edumatic Exam are Bert Vandamme, Sem Dendoncker, Wouter Vanden Berghe and me.

Cheers and practice!

<

SQL Server DateTime v’s .Net DateTime – Battle of Accuracy!

Posted by admin on June 10th, 2009

Link

<

Rounding up last month – Pex, Mocks, NSK, CHESS, Linq, Silverlight, TechDays

Posted by admin on April 4th, 2009

It has been a while since I wrote anything, but that's mainly because we have a new family member... Romée, a beautifull daughter, six weeks old!

dsc_0220

Back to the usual stuff. What have I been doing the last month. Well, there were Techdays, on which I wrote a few things but I still need to round that up. I also went looking for best practises to build a .NET layered application. The Northwind Starters Kit was most usefull for this. And there were also the Mocking frameworks, which seemed very complex at first (like everything in it it appears to be very simple afterwards...).

Pex & Chess

Very inspiring talk on Techdays about automated White box Testing and finding and reproducing Heisenbugs in concurrent programs. There was an example of a team that got a report of a bug that had to do with concurrency they just couldn't reproduce. They let CHESS do its thing and in less than a minute they found the bug. Very impressive.

Mocking frameworks

In my Flex projects I had already used mocks, but they weren't exactly mocks... Now that I began exploring .NET architecture, I really found out what these mocking frameworks are about. And they impressed me. Certainly the fact that if you want to use mocking frameworks you need good design, is interesting. To me it seems that a mocking framework is very good to test your base design (framework), if it's done using principles described in books like Patterns of Enterprise Application Architecture or Domain driven Design (or others).

Northwind Starters Kit

This Kit has helped me a lot in having a good example of how you could implement a good .NET layered architecture. I also checked out DinnerNow, but things went wrong when installing (and I just hate that -- if you're limited in time, you don't want to go looking why this or that doesn't install properly. If I have to make installers for cd-roms, they need to work...). I'm now implementing a very small part of a product of ours with this NSK example. I will also try to check out a few mocking frameworks and a few IoC frameworks and integrate them in this small part. The best way to check out this NSK is to checkout the svn repo.

SilverLight

A few good presentations on SilverLight at TechDays. I certainly think they got a lot of advantages over Flex, but it will still take a lot of time. What really annoys me a lot is the arrogance by which some presentators present SilverLight. Anyway, their CLR seems a lot more robust that the Flash Player, but so far I haven't seen business solutions being created with SilverLight. So I'm actually waiting a little bit on such examples. Now it's always very simple examples or interactive sites that really don't have to deal with a lot of data. There was a neat example of a Chess Game where they let a Javascript engine play against an .NET engine (SilverLight). SilverLight always won and could precess a lot more paths/second. A colleague of mine ported the engine to Flash, and could then compare Flash against .NET. The original game can be found here. The blog post from my colleague here. After the presentation on this, I asked a Microsoft guy how Flash would compare to this. He told me you couldn't do this in Flash. Mmmm.

Linq

Very good presentation on Linq! Now I now what Monads are (look them up in Wikipedia). I haven't used Linq all that much, but loving maths I'm interested in how this is implemented. The presentator quickly went deep into the subject which was fantastic (but also sometimes a labyrinth). Also the possibility to extend Linq to any other sort of data is great.

Oslo

Seemed very interesting, but I'll have to check more examples to know how this could be used in every day development. The custom parser seemed very powerfull if you would need to convert data to another format.

Cheers, Lieven Cardoen

<

TechDays Day I: Software + Services: The convergence of Saas, SOA and Web 2.0

Posted by admin on March 14th, 2009

Very motivational and interesting presentation, especially because of the different existing examples around on the net.

First of all, everything is about data and how to bring it to clients (whether they are users or other applications) and bringing software above the level of a single device.

An interesting book that was talked about is "Place to Space" by Peter Weill & Michael R. Vitale. "Place to Space" deals with the business models an e-business can adopt. The central idea of the book is that there are 8 atomic business models that exist. It's a very interesting way to model for example cash flow, product delivery, ...

Cool examples:

Eve Online : Very impressive game.
Photosynth I had seen this before and I really will try to make one myself.
British Library Well, this is less fantastic to me in terms of GUI, but it is a enormous access to data.
WorldWide Telescope Very impressive!
Yosemite Extreme Panoramic Imaging Project Also very impressive. Click on result by the way.

The Cloud was off course a topic in this presentation with the .NET Services and SQL Services. Will look into these in the coming weeks.

Lieven Cardoen

<

TechDays Day I: Identity & Cloud Services

Posted by admin on March 14th, 2009

In this presentation I kinda got lost a couple of times. I hoped to see some examples of Azure in practice, but this wasn't really the case (except one example that I hope to see soon on the blog of Vittorio Bertocci).

My interest was more in Azure for Web Developers. Azure Service Platform is designed to help developers create, deploy, manage and distribute web applications and services. Also, if you have a lot of traffic and load, you'll pay more, otherwise you'll pay less. Hosting is provided for you.

I'll just need to try it out. I know WebORB has managed to run their applications in the Cloud, so it shouldn't be a problem.

Quote:

Next time you'll want to build something in house, ask yourself:
Do I really need a generator here, or could I just connect a plug?

Link to Azure Services Platform

thx, Lieven Cardoen

<

Copyright © 2007 Johlero – Cardoen Lieven. All rights reserved.