|
Page 1 of 2
Using UML with Java
While Java is not a new language, its application for the development of embedded systems is quite new. Developers are beginning to take a second look at modeling languages such as UML, and many feel it can be a powerful tool in their development arsenal.
Introduction
Java and UML are both gaining rapid popularity in the development community at the same time, and it is only logical to assume that someone would eventually propose the idea of using them together. While many developers felt UML was too big and bulky for embedded system in the past, these attitudes have changed in recent years. Additionally, the introduction of the Java 2 Micro Edition has also reinforced these views.
It should be noted that when Java is used with embedded systems, it is not limited to J2ME. However, it appears that J2ME is the current front runner in this process. It is being heavily used for the development of devices which are embedded or handheld, and Java has a language has many strengths that will appeal to those who are in the development community. Some examples of this include support for object oriented programming methods, and exception handling, existing frameworks, and a runtime environment that is stable. In recent years, the Java runtime has undergone dramatic improvements. Much of this is a result of using the "just in time compiler", as well as the virtual machines.
While the memory of Java is much larger than most C based applications, it uses VMs which are smaller and more efficient. These are just a few of the features that Java brings to developers who work with embedded systems. If you're tired of spending hours debugging various applications, there is no doubt that you will welcome the object oriented features that Java uses. However, while Java may help developers get rid of a number of annoying problems; it is not a cure all. Because highly complex Java devices are being built on a regular basis, the demand for more complex forms of behavior will also increase.
Challenges that Developers face with complex Java devices
While complex Java applications can be hard to build, it is likely that they have a number of features that make it worth it. Some of these could include reliability and concurrency. The J2ME applications are embedded, and they must be able to have quick reactions to inputs that come from either users or devices. In many situations, a program may have device drivers, user interfaces, and network connections that require concurrent behavior that is complex. One element that can be helpful in a situation like this is the active object. An active object is one that has a thread of control which is unique to it. The biggest problem with many Java objects is that they are passive.
These objects will only react to specific method calls, and they will be inactive if no method is called. Because an active object has its own thread of control, it can process messages that it receives via a message queue. Unlike most Java objects, it is not limited to a method call. Message queues are powerful because they allow a form of communication which is asynchronous. The active object can carry out various tasks as the messages arrive. The messages will be processed once these activities are finished. Now, those of you who have read this far may be wondering how UML is related to this. The relationship lies in the fact that the active object can only be modeled directly in UML.
The Unified Modeling Language provides a strong building block which will allow for the development within systems that are embedded. UML has a number of unique characteristics, and these attributes have allowed it to be useful for programmers who want to design embedded applications.
Some of the features it has include protocols and ports, and it also uses capsules as well. The capsule is a special class which has its own control thread. It can communicate with other capsules by utilizing a message queue, and it can also symbolize active objects in UML. The capsule comprises the UML tool kit, and it can address various needs that most embedded developers can relate to.
|