Introduction to Software Components the Java Beans specs

Introduction to Software Components: the Java. Beans specs Babak Esfandiari

Software Components l l l Component: "Encapsulated software object that provides a certain functionality or service and can be used in conjunction with other components to build applications. " one should be able to develop applications by selecting components from a catalog and compose them. the catalogs and the components might reside on remote hosts

Software Components l To be reusable, components: – – expose a public interface behave according to explicit specifications are oblivious to their clients can be assembled graphically

Java. Beans l Java's component model

Java. Beans Concepts “ A Java Bean is a reusable software component that can be manipulated visually in a builder tool” -> JDK 1. 1 l l l introspection customization events properties persistence

Introspection l Java. Beans assembly tools such as the Bean. Box are able to discover Bean properties and expose them using introspection – – the Java Reflection API is used Beans must follow a certain number of coding idioms l l default constructor public methods getters/setters events

Customization l l once Bean properties are discovered, they can be changed using introspection it is possible to change the way properties are accessed and modified

Events l Java. Beans use the Java Event model – – Event. Object class Event. Listeners

Persistence l l Instantiated Java. Beans' states can be saved and restored using serialization long-term persistence achieved with XML
- Slides: 9