Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesRebuilt Parts


October 1997 / Javatalk / Rebuilt Parts

Parts for Java delivers an excellent visual-programming environment for Java.

Rick Grehan

Well known for its Smalltalk-based products, ParcPlace-Digitalk (via its ObjectShare division) has released Parts for Java (PFJ). This is an integrated development environment (IDE) for Java development that inherits much from its Smalltalk parentage. The migration of the part concept, PFJ's atomic component, from Smalltalk to Java has been made possible largely thanks to the ongoing maturing of the Java bean. A PFJ part is a bean.

As the Java Development Kit's (JDK) beans definition has solidified and support for beans in the Java community has improved, "bean mec hanics" have become more and more sophisticated. A growin g number of Java development systems incorporate robust bean support; such is the case with PFJ.

PFJ's parts are the visual and nonvisual objects that populate a PFJ application (or applet). You create a Java application by the now-familiar activity of dragging and dropping parts into a Java application's frame.

Once a part (which is really a bean) is in place, you modify its characteristics through property sheets -- dialog boxes that are packaged with the part (rather than being part of the IDE) and that provide access to a part's characteristics (such as its color or font).

Ordinarily, you access a part's property sheet by double-clicking on the part. PFJ improves on the bare-bones property sheet dialog box by adding a drop-down listbox (within each property sheet dialog box) that provides quick access to other parts in the application. This allows you to rapidly move from one part to another in the application; you don't have to close the dialog box and then click on the next part to open the new property sheet dialog box.

Programming with Wires

I've seen many implementations of visual programming by means of wiring together on-screen objects, such as buttons or scroll bars. IBM's Visual Age for Java was my most recent encounter with an IDE that used this paradigm. (In fact, Visual Age also used parts as the fundamental visual-programming component.) PFJ demonstrates what I think is -- so far, at least -- the best visual-programming environment of this sort for Java.

For example, suppose you want to establish a relationship between one part that is an event source and another that is the recipient of (and will respond to) that event. If you right-click on the source part and drag to the destination part, PFJ opens a dialog box showing the events provided by the source and the responding methods offered by the destination. Select the event and receiving method, and PFJ will deposit the correct source code in your application's .java files.

Simultaneously, PFJ draws a connecting line between source and destination parts, and displays floating text boxes that carry the prototypes of the source event and recipient method. PFJ inserts placeholders in the latter's argument list; each placeholder consists of the corresponding object's data type and a solid-color diamond. (The diamond is replaced with the actual argument once you complete the definition of the method call.) If a link is incomplete -- perhaps you haven't specified arguments needed in the receiving method -- it glows red. (If you're building a complex user interface, this helps you quickly spot portions of the application that are unfinished.)

PFJ handles complex event/target relationships easily. That is, although an event implies a source part, which generates an event, and a target part, which responds to that event, the relationship can be more elaborate than that. For example, the target mi ght call a third part to supply an argument for the target method. Just as you can wire the source and target together, you can connect a part to an argument in the target's method. That's where the placeholders come into play. They act as anchors for the connection between part and argument.

So, suppose that in response to a button-click event, a listbox copies the contents of a text box into the list. You can create a link between the text box and the method called in the listbox by right-clicking on and dragging between the placeholder I mentioned earlier and the text box. The IDE will open a dialog box showing available "getter" methods in the text-box part for retrieving the text box's current string. When you select the proper getter method, PFJ does the coding for you.

Compliant with JDK 1.1.2

PFJ supports the JDK 1.1.2's delegation event model. This makes it among the first IDEs that I've seen with explicit support for the delegation event model, though more JDK 1.1.2-compliant ID Es will probably be available by the time you read this. Now, instead of PFJ generating an explicit source code event loop for managing event/target links, it simply generates a method call that registers the destination part as an "action listener" to the source part.

The source code that PFJ generates is deceptively simple. This simplicity is due partially to the delegation event model (and the consequent lack of an event loop). It's also due partially to the implementation of parts as beans. This latter fact means that a part's behavior is encapsulated in the bean and never appears in the source code that PFJ automatically generates. Nevertheless, because so much behavior is abstracted into the parts, the mechanics of the generated code are quite easy to comprehend.

Good Parts

Beyond the IDE, PFJ also includes support for Common Object Request Broker Architecture (CORBA) and remote method invocation (RMI). On the CORBA side, PFJ arrives with a trial version of Iona's OrbixWeb (which su pports IIOP). On the RMI side, PFJ's RMI wizard guides you through setting up both sides of a remote method call.

PFJ's ClassMaster browser is its most obvious inheritance from the Smalltalk world. A classic three-pane browser, ClassMaster provides a unified view of a given class. That is, it will show you not only methods defined within the class, it will also show you any methods that the class inherits from its superclass in a single view. In that way, you can quickly get a picture of a class's total functionality.

Finally, PFJ's debugger, which is multithreaded and as good as any that I have seen, is written entirely in Java. That makes it portable to any platform that supports Java.

Although I haven't tried it yet, this portability should allow you to tackle those situations where an application runs well on one platform but fails on another (yes, this sometimes happens with Java applets). You can move the debugger wherever you need it.

Parts for Java is available from ObjectShare for a price of $149. You can purchase it at the following Web site: http://www.objectshare.com .


Product Information


ObjectShare

Sunnyvale, CA
Phone:    408-720-7585
Internet: 
http://www.objectshare.com



Information on products in the programming category HotBYTEs - informa tion on products covered or advertised in BYTE

Link 'Em Up

screen_link (33 Kbytes)

PFJ's create link dialog box shows available events and compatible receiving methods.


Rick Grehan is a senior editor at Computer Design magazine and coauthor of The Client/Server Toolkit (NobleNet, 1996). You can reach him at rickg@pennwell.com .

Up to the Javatalk section contentsGo to next article: Java Gets PersonalSearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM  
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network