JavaBeans - a new component architecture
OVERVIEW
Features

JAVABEANS VS ACTIVEX
What is ActiveX?
How are ActiveX controls created?
How does Java stack up?

CONCLUSION

JavaBeans is a new component architecture for Sun's Java language. Like the language from which JavaBeans draws its name, it is portable across many platforms; any environment supporting a JDK 1.1 interpreter will be capable of using JavaBeans.

Overview

For Java developers, and amateur applet authors, JavaBeans offers the ability to write applications quickly and easily, by using a palette of components that can be assembled to form a larger application. User-interface components, such as trees, lists, or graphical buttons can make applications come alive, without the need for writing custom components for each and every application. Networking protocols can be encapsulated in a component, allowing developers to simply plug in email and web support into their applications. Literally any component you can imagine can be written as a JavaBean, and then plugged into an application.

Features

  • JavaBeans support properties, allowing an application to read and modify their values.
  • JavaBeans support events, allowing vendors to create their own unique events.
  • JavaBeans support the BeanInfo interface, allowing vendors to specify exactly which properties and methods are available, and icons for beans which can be displayed on a toolbar.
  • JavaBeans are highly configurable, and the state of a bean can be saved and restored through 'serialization'.

JavaBeans vs. ActiveX

What is ActiveX?

ActiveX is a competing object technology, developed by Microsoft for its Windows platform. ActiveX objects are similar to the OCX components, and allow vendors to create components that can be used in products such as Visual C++, Visual Basic and Borland Delphi.

How are ActiveX controls created?

ActiveX controls can be created in a variety of languages, such as Visual Basic Control Creation Edition, or Visual C++. The task of creating controls, however, is often more difficult than the simplicity of JavaBeans.

How does Java stack up to ActiveX?

Java stacks up very well indeed! JavaBeans are highly portable, and can run on any platform that has a Java Virtual Machine that is JDK1.1 compliant. ActiveX controls can execute on the Windows platform, and most use Win32 specific calls that would render them unsuitable for automatic porting to other platforms. While ActiveX is now being pushed as an open standard, it will be some time (if ever) before we see truly portable ActiveX controls.

There is also a common misperception amongst developers that JavaBeans can only be used in Java applications, and thus are not integratable with other products, such as Visual Basic and Delphi. This is not so! Any existing JavaBean can be instantly converted into an ActiveX control, through the use of the JavaBeans ActiveX Bridge.

The bridge takes an existing JavaBean, and registers it as an ActiveX control that can be used in any ActiveX compatible application or programming language. Not only is the JavaBean architecture portable across platforms, it's portable across other languages!

Conclusion

JavaBeans have a significant competitive advantage over ActiveX - JavaBeans can be instantly converted into ActiveX controls via the bridge, but ActiveX controls cannot be easily converted into JavaBeans. JavaBeans also offer the security and robustness that developers have come to know and love, whereas ActiveX controls remain dangerous (despite the innovation of digital signatures), as they have low level access to features of the operating system. JavaBeans used in applets are bound by the same restrictions (file and network access) as their applet hosts, yet ActiveX controls that are signed have a much larger potential to wreak havoc on the system. Coupled with their lack of portability, ActiveX components have a smaller target audience, and there is a perception that they can be dangerous when executed indiscriminately from the web.

For the serious component vendor, or application developer, JavaBeans is an important new technology that must be learnt to stay ahead. ActiveX has its place, for now, but with the introduction of the JavaBeans Bridge, it would be prudent to learn the JavaBeans architecture while it remains in its infancy.

Java
Java
Java is a platform independent language that can be executed in web browsers, as well as stand-alone applications. Supported by industry leaders Sun, Microsoft and IBM, Java may be our last, best hope for a universal language.

ActiveX
ActiveX
ActiveX is a competing object technology for the Windows platform. Supported by Microsoft, ActiveX is a powerful component architecture that competes against JavaBeans


Java, JavaBeans is a trademark of Sun. Microsoft, Visual Basic, Visual C++, ActiveX is a trademark of Microsoft corporation. Delphi is a trademark of Borland Corporation.   Copyright 1997, David Reilly