JavaBeans CORBA Segment

Magic Beans: Data Beans

Ozgur Balsoy 
CPS 714 Fall 97
 
Introduction
 
     In 2-tier computing systems using JDBC as a database bridge, software developers write static code segments meaning that whenever there is a change in database schema, Java classes developed in the source need to be updated. Data beans solve this problem in simple browse/edit database applications, and make programming a lot easier.
 
  Data Beans
 
   
Data beans structure

There are two groups of data beans, namely data controls and bound controls (or data aware beans). Data controls group consists of only one data control bean, and the other group may have many bound control beans. For each database connection, Java applications should have a data control bean. The connection property of this bean is set to a URL which links to the database location i.e. jdbc:odbc:db. The data source property of the bean is a query statement which defines the rows to be retrieved. This bean also provides navigation buttons to browse through the database. 

Bound control beans look like Java AWT components. However, each bean is bound to a data field of the result of the query which any data control bean of the application evaluates. The current value of a bean reflects the current value of its corresponding field of the current record in a data control. Whenever users or the application itself change the current record of data controls, every bean's value is updated automatically. 

Data beans save a lot of time and code for the developers of such database applications. They can find their way in many application areas easily. Whenever they are ported to 3-tier systems, it looks like they will be very popular among developers.

 
    References