Friday, May 28, 2010

The System Design Lesson

this is how they taught you to draw Use Case Diagrams:



And here is the way I recommend you draw them:

Thursday, May 27, 2010

I found something interesting



Class Diagram Update



But still working on the SQLEmbedded and CommMessageProcessor classes. I found a cool way to embed a MySQL server into a Java application. If you ever need to do that google the MySQL-connector-MXJ 5.0.11. You may have to use it together with the well known MySQL-connector-Java 5.1.10

Friday, May 21, 2010

Java RXTX close port solution




class CloseThread extends Thread
{
   public void run()
   {
      serialPort.removeEventListener();
      serialPort.close();
   }
}


public void closePort()
{

   try
   {
      if (serialPort != null)
      {
         serialPort.getInputStream().close();
         serialPort.getOutputStream().close();

         new CloseThread().start();

      }

   } catch (Exception e) {}
}
/*
Late Note(11.17.2011): I see that there are plenty of views on this article and after more than one year I realize that the context might look ambiguous. What I didn't mention before is that this is an inner class to the class in which you have the methods for communicating over the serial port, and in here serialPort is an object of the SerialPort class.
*/