Java Technology Home Page
A-Z Index

Java Developer Connection(SM)
Online Training

Downloads, APIs, Documentation
Java Developer Connection
Tutorials, Tech Articles, Training
Online Support
Community Discussion
News & Events from Everywhere
Products from Everywhere
How Java Technology is Used Worldwide
 
Training Index

Introduction to the JavaBeans API
Magercises

by John Zukowski, MageLang Institute

[Short Course | About This Short Course]

These Magercises show how to use the JavaBeansTM API and its component parts to develop component-based solutions with JavaTM technologies. The Magercises tour the Beans Development Kit (BDK) and its BeanBox tool and demonstrate JavaBeans component manipulation within the BeanBox.

In addition, there are Magercises to create JavaBeans components, bean-info classes, custom property editors, and customization dialogs.

Magercise Outline

About Magercises

A Magercise is a flexible exercise that provides varying levels of help according to the student's needs. Some students may complete the magercise using only the information and the task list in the Magercise body; some may want a few hints (Help); while others may want a step-by-step guide to successful completion (Solution). Since complete solutions are provided in addition to help, students can skip a Magercise (or several) and still be able to complete later Magercises that required the skipped one(s).

The Anatomy of a Magercise

Each Magercise includes a list of any prerequisite Magercises, a list of skeleton code for you to start with, links to necessary API pages, and a text description of the Magercise's educational goal. In addition, buttons link you to the following information:
  • Help: Gives you help or hints on the current Magercise (an annotated solution). For ease of use, the task information is duplicated on the help page with the actual help information indented beneath it.
  • Solution: The <applet> tag and JavaTM source resulting in the expected behavior.
  • API Documentation: A link directly to any necessary online API documentation.

Magercise Design Goals

There are three fundamental magercise types that you may encounter:
"Blank screen"
You are confronted with a "blank screen" and you create the entire desired functionality yourself.
Extension
You extend the functionality of an existing, correctly-working program.
Repair
You repair undesirable behavior in an existing program.

To make learning easier, Magercises, where possible, address only the specific technique being taught in that Magercise. Irrelevant, unrelated, and overly complex materials are avoided.

Where possible, Magercises execute via the web. However, Magercises that must access Java features or library elements that could cause security violations are not executed on the web.

Magercises, Introduction to the JavaBeans API

  1. The Beans Development Kit

    This Magercise uses the Beans Development Kit (BDK). It introduces the BeanBox, a Bean testing tool, and describes how to connect two command button Beans with a juggler Bean.

    Educational goal(s):

    • To be familiar with the Beans Development Kit (BDK)
    • To learn how to connect Beans using event communication
    • To understand how to configure a Bean's properties

  2. Working with Beans

    This Magercise uses the Beans Development Kit (BDK) to load a Bean, Simple, which you first develop and then package in a JAR file.

    Educational goal(s):

    • To become familiar with basic Bean development procedures
    • To understand how to package a Bean for use with a Bean-aware tool

  3. The StickFigure Bean with Properties

    This Magercise uses the Beans Development Kit (BDK), or a comparable Bean-aware development environment, to load a Bean, StickFigure, and manipulate the Bean's characteristics. For this Magercise, you supplement the Bean's functionality by adding a bound property.

    Educational goal(s):

    • To become familiar with basic Bean development procedures
    • To understand how to package a Bean for use with a Bean-aware tool
    • To become familiar with the JavaBeans design patterns for properties

  4. The StickFigure Bean with Control Methods

    This Magercise uses the Beans Development Kit (BDK), or a comparable Bean-aware development environment, to load the Bean, StickFigure, and manipulate the Bean's behavior. For this Magercise, you supplement the Bean's functionality by adding a surprise state, plus control methods for manipulating the state of surprise.

    Educational goal(s):

    • To emphasize Bean connectivity design issues

  5. The StickFigure Bean with BeanInfo Support

    This Magercise uses the Beans Development Kit (BDK), or a comparable Bean-aware development environment, to load a Bean, StickFigure, and verify the Bean's icon. For this Magercise, you add a minimal bean-info class that specifies an icon for the Bean.

    Educational goal(s):

    • To become familiar with bean-info classes

  6. The StickFigure Bean with a Custom Property Editor

    This Magercise uses the Beans Development Kit (BDK), or a comparable Bean-aware development environment, to load a Bean, StickFigure, and verify the behavior of a custom property editor. For this Magercise, you design and implement a property editor for the Bean's "mood" property.

    Educational goal(s):

    • To become familiar with custom property editors

  7. The StickFigure Bean with a Customizer Dialog

    This Magercise uses the Beans Development Kit (BDK), or a comparable Bean-aware development environment, to load a Bean, StickFigure, and verify the behavior of a customizer dialog. For this Magercise, you design and implement a customization dialog for the Bean's properties.

    Educational goal(s):

    • To become familiar with customization dialogs

  8. Exploring Bean Customization: FlexLabel

    This Magercise uses the Beans Development Kit (BDK), or a comparable Bean-aware development environment, to load the Bean, FlexLabel, and explore the JavaBeans framework's customization facilities.

    Educational goal(s):

    • To become more familiar with JavaBeans customization facilities

  9. A Client Socket Bean

    This Magercise uses the Beans Development Kit (BDK) to design and test a nongraphical Bean that implements client-socket functionality. The Bean makes a socket connection to, for example, an echo server or a date-time server, and then reads from and/or writes to the socket, depending on the server's functionality.

    Educational goal(s):

    • To gain experience with nongraphical Beans
    • To become accustomed to "Bean-ifying" nongraphical Java classes
    • To gain experience with client-level sockets

  10. A URL Hex Dump Bean

    This Magercise uses the Beans Development Kit (BDK) to design and test a nongraphical URL Bean. The Bean makes a URL connection to a local file or a remote HTTP address, and then performs a hex dump of the data at the specified URL.

    Educational goal(s):

    • To gain experience with nongraphical Beans
    • To become accustomed to "Bean-ifying" nongraphical Java classes

  11. A JDBCTM Bean Database Manager

    This Magercise uses the Beans Development Kit (BDK) to design and test a nongraphical Bean that implements a front-end to a database system, that is, a simple middle-tier application server.

    Educational goal(s):

    • To gain experience with Bean-oriented application services

  12. Exploring an HTML Browser Bean

    This Magercise uses the Beans Development Kit (BDK) to load a prepackaged HTML Browser Bean suite and explore its capabilites.

    Educational goal(s):

    • To become aware of currently available technology delivered as Beans

Copyright © 1998-1999 MageLang Institute. All Rights Reserved.


[ This page was updated: 27-Oct-99 ]

Products & APIs | Developer Connection | Docs & Training | Online Support
Community Discussion | Industry News | Solutions Marketplace | Case Studies
Glossary - Applets - Tutorial - Employment - Business & Licensing - Java Store - Java in the Real World
FAQ | Feedback | Map | A-Z Index
For more information on Java technology
and other software from Sun Microsystems, call:
(800) 786-7638
Outside the U.S. and Canada, dial your country's AT&T Direct Access Number first.
Sun Microsystems, Inc.
Copyright © 1995-99 Sun Microsystems, Inc.
All Rights Reserved. Legal Terms. Privacy Policy.