Welcome!

Java IoT Authors: Elizabeth White, Yeshim Deniz, Liz McMillan, Zakia Bouachraoui, William Schmarzo

Related Topics: Java IoT

Java IoT: Article

Code Warrior

Code Warrior

Since the introduction of Java and Sun's Java Development Kit over nine months ago, Mac users have been left out in the cold waiting for their turn to get the slick GUI development environments. Sun finally came out with the JDK for the Mac, and now Metrowerks, whose CodeWarrior development environment has dominated the Macintosh programming tool market, has extended its reach to include Java with the recent release of CodeWarrior Gold 9. In this issue the Java Developer's Journal will take a look at CodeWarrior Gold 9 and let you know how it stacks up.

First Impressions
CodeWarrior Gold is Metrowerks' professional bundle, providing an extensive development environment with several languages (C, C++, Object Pascal, Java) and target platforms (Mac, Windows, BeBox, MagicCap). With the Gold package, you get a QuickStart manual, and 2 CD-ROM's: one containing the tool set and the other containing documentation and examples. Documentation is generally provided in both eDOC and Acrobat formats, with readers provided. A full installation of the CodeWarrior Gold tool set would require almost 240Mbytes of disk space! With a development environment this complex, it would be easy for a first-time user to get lost; Metrowerks provides a Java-specific document on the second CD that explains how to use the various tools from a Java perspective. This document is a good starting point for someone new to CodeWarrior. Ignoring the many other aspects of CodeWarrior Gold, this review covers only Java development.

The documentation identified the Java support as Beta. However, the parts of CodeWarrior that are not Java-specific (such as project management and editing) are solid. CodeWarrior 9 appears to be based on JavaSoft's JDK 1.0.1 (as indicated by the appletviewer properties).

Getting Started
The Java-only environment created using the installer only occupies about 13MByte of disk space; this figure does not include API documentation or sample code. CodeWarrior Gold 9 provides Java support for PowerPC as well as 68K Macs; in fact, this version of CodeWarrior works fine even on old 68030 machines. CodeWarrior works using the, now common, project-centric approach. When creating a new project, you can select from a variety of predefined stationary that automatically configures many of the per-project preferences. For each file in the project, the project window indicates if the file needs to be compiled, its code size, and if debugging information is generated. You can mix Java and non-Java files in the project to keep track of all files related to a project; CodeWarrior only attempts to compile the files containing Java as indicated by file extension or type. Of course, CodeWarrior keeps track of the status of your source files and only compiles the files that are out-of-date. You can manually trigger a recompile from the project window.

A project can be one of four types: the usual "class folder" where the .class files for the applet are placed in a separate folder; a ".zip" where CodeWarrior automatically builds a single Java-compatible .zip library file of your classes; a "runnable .zip"; or a "droplet." These last two project types give CodeWarrior a unique advantage when developing Java applications. For a "runnable .zip", CodeWarrior embeds the .zip library file into a dummy application that, in turn, invokes the Java virtual machine when launched. A "droplet" extends this concept further to allow you to build a drag-and-drop Java application where the name of the "dropped" file is automatically provided as the first parameter to main().

CodeWarrior Gold does not provide any facilities for source code control. An optional source-code control application is available.

Code Editor
CodeWarrior provides a fairly standard source code editor that can color comments, keywords and strings differently, but does not provide a reformatting function nor tools for inserting templates for class, method or HTML definitions. The editor does provide support for both horizontal and vertical window "panes" and a quick navigation pop-up menu to move to a given function declaration. The editor, if not notable, is solid.

Class Browser
CodeWarrior incorporates several different styles of browsers to help the user navigate through their various source files. You can display a "catalog" of items, such as methods and classes, from the project. The catalog window provides a quick way to view a listing of all classes or functions in the current project; however, the method display window is a bit crowded since it gives the fully quantified declaration for a function, and it didn't identify as "constants" the Java convention of final static declarations. The multi-class browser provides the next level of detail; it shows the class hierarchy, method definitions, local variables, and a lower window pane for editing. A detailed, single-class browser can be invoked from the class display in the catalog. This browser window shows the "bases" of the class, that is the classes it extends or implements; a listing of methods, a listing of instance variables and the source code related to the select method or variable; you can also edit this source code directly in this lower window pane.

Though they provide adequate functionality, these separate browser modes seems somewhat clumsy when compared to the class browsing offered by other environments.

Runtime
Metrowerks merged several of JavaSoft's Java runtime programs into a single application called "Metrowerks Java." This application can function as an applet viewer, an application runner, a Java compiler (the standard JavaSoft reference version), class dumper, and header file generator. Because JavaSoft's standard Java runtime cannot unload a class, you need to quit Metrowerks Java and restart it after recompiling your source code. You can control various parameters of the virtual machine operation, including class search paths, heap and code stack sizes, and garbage collection rules.

The Java runtime provides a console output window for program diagnostic messages, a display of virtual machine status (CPU load and memory usage) and a thread state indicator. The thread state window shows a moving history of the state of all threads in the system and their transitions between states.

Given CodeWarrior's multi-language abilities, it is natural that it should support native Java functions. Alas, native methods are not yet fully supported; more information about what you can do with native methods is available from Metrowerks technical support.

Debugger
Aside from application development support, the other distinguishing feature of CodeWarrior is its source-level debugger. Though there are a few missing features in this beta release, you are able to set and clear breakpoints by clicking next to a source line of text, view the call chain, step through code, and inspect variables. You can also set breakpoints to catch the various Java exceptions without actually adding code to your application. You can even invoke the debugger against an already running applications or applet. I had several crashes on a 68K Mac when trying to view byte-codes; but since source display worked fine and is the obvious preference, the debugger is quite usable even on old machines.

Conclusions
While Metrowerks is a relatively late-comer to the Java market, its leadership in the C/C++ development market is providing a solid base from which to become the dominant supplier of Java tools also. The stability of this Beta release stems in large part from Metrowerks' ability to extend their proven development environment, though there are places where the use of non-Java terminology may be initially confusing. CodeWarrior Gold 9 offers solid Java performance and some interesting new twists for building applications.

More Stories By Jim Mathis

Jim Mathis is a freelance Java and JavaScript consultant and a communications systems architect. Jim is a contributing writer to Java Developer's Journal and has been active in the Internet community from its very beginnings and wrote one of the first implementations of TCP/IP.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


IoT & Smart Cities Stories
Nicolas Fierro is CEO of MIMIR Blockchain Solutions. He is a programmer, technologist, and operations dev who has worked with Ethereum and blockchain since 2014. His knowledge in blockchain dates to when he performed dev ops services to the Ethereum Foundation as one the privileged few developers to work with the original core team in Switzerland.
In his general session at 19th Cloud Expo, Manish Dixit, VP of Product and Engineering at Dice, discussed how Dice leverages data insights and tools to help both tech professionals and recruiters better understand how skills relate to each other and which skills are in high demand using interactive visualizations and salary indicator tools to maximize earning potential. Manish Dixit is VP of Product and Engineering at Dice. As the leader of the Product, Engineering and Data Sciences team at D...
Dynatrace is an application performance management software company with products for the information technology departments and digital business owners of medium and large businesses. Building the Future of Monitoring with Artificial Intelligence. Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more busine...
Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science," is responsible for setting the strategy and defining the Big Data service offerings and capabilities for EMC Global Services Big Data Practice. As the CTO for the Big Data Practice, he is responsible for working with organizations to help them identify where and how to start their big data journeys. He's written several white papers, is an avid blogge...
René Bostic is the Technical VP of the IBM Cloud Unit in North America. Enjoying her career with IBM during the modern millennial technological era, she is an expert in cloud computing, DevOps and emerging cloud technologies such as Blockchain. Her strengths and core competencies include a proven record of accomplishments in consensus building at all levels to assess, plan, and implement enterprise and cloud computing solutions. René is a member of the Society of Women Engineers (SWE) and a m...
Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settlement products to hedge funds and investment banks. After, he co-founded a revenue cycle management company where he learned about Bitcoin and eventually Ethereal. Andrew's role at ConsenSys Enterprise is a mul...
Whenever a new technology hits the high points of hype, everyone starts talking about it like it will solve all their business problems. Blockchain is one of those technologies. According to Gartner's latest report on the hype cycle of emerging technologies, blockchain has just passed the peak of their hype cycle curve. If you read the news articles about it, one would think it has taken over the technology world. No disruptive technology is without its challenges and potential impediments t...
If a machine can invent, does this mean the end of the patent system as we know it? The patent system, both in the US and Europe, allows companies to protect their inventions and helps foster innovation. However, Artificial Intelligence (AI) could be set to disrupt the patent system as we know it. This talk will examine how AI may change the patent landscape in the years to come. Furthermore, ways in which companies can best protect their AI related inventions will be examined from both a US and...
Bill Schmarzo, Tech Chair of "Big Data | Analytics" of upcoming CloudEXPO | DXWorldEXPO New York (November 12-13, 2018, New York City) today announced the outline and schedule of the track. "The track has been designed in experience/degree order," said Schmarzo. "So, that folks who attend the entire track can leave the conference with some of the skills necessary to get their work done when they get back to their offices. It actually ties back to some work that I'm doing at the University of San...
When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things'). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing. IoT is not about the devices, its about the data consumed and generated. The devices are tools, mechanisms, conduits. This paper discusses the considerations when dealing with the...