Download presentation
Presentation is loading. Please wait.
Published byKory Marsh Modified over 9 years ago
1
Java Beans Component Technology Integrated, Visual Development Environments Reusable Platform-Independent Modular
2
Java Bean Concepts Visual Composition or Programming Components expose their features (public methods and events) to builder tools Features adhere to specific design patterns Forte or NetBeans for IDE
3
Component Model Building Block Approach to Software Development Components are self-contained elements of software Dynamic Control Assembled to form Applications Interact according to rules and guidelines
4
Component Characteristics Containment Discovery and Registration Events Persistance Visual Presentation
5
Containment Implicit in Model is concept of container in which components interact Containers can be components
6
Discovery and Registration Java has built in mechanisms for class and interface discovery Used to locate a component at runtime Used to determine supported interface for use by other components Reflection API
7
Advantages Late binding allows components and applications to be developed independently Interface define contract between component and application Application does not include component in order to use it at runtime. Just has to know what it is capable of doing
8
Feature Discovery Discovery of Features (properties, methods, events) through INTROSPECTION Design Patterns when naming features. Reflection API ( Introspector class) Feature information in a Bean Information class
9
Java Runtime JRE - Java Runtime Environment Runtime portion of development kit Contains core API Maintains Class object for each class Represents or Reflects class Reflection API invokes methods on Class object
10
Reflection API Classes, Interfaces, and Objects in current JVM Discovery at runtime Determine Class of an Object Get Information about Class (modifiers, fields, methods, constructors, superclass) Constants and method declarations in interface
11
Create an instance of a class whose name is not known at runtime Get and set value of objects field, even if unknown at runtime Invoke method on an object, even if unknown at runtime Create new array, whose size and components are not known at runtime
12
Events Event occurs at specific point in time Events generated by actors (User, other systems, components) Components notify other Components when events take place Communication mechanism with well- defined interface
13
Events Events used to communicate with other Beans A bean that wants to receive notification of an event (a listener Bean) registers its interest with Bean that fires the event (a source Bean).
14
Persistence Beans are able to save and store state, then, restore it Object Serialization is key technology
15
Persistence State of the Component Persistence: Store and Restore State Components participate in containers persistence mechanism Uniform Persistance Mechanism
16
Visual Presentation Component itself may or may not be visual Related to container object Support Visual Programming Proceed by altering properties, managing events
17
Properties Properties are Bean’s behavior and appearance attributes that can be changed at design time. Properties exposed for customization Customization by Property Editors or more custom classes
18
Bean Development Kit BDK separate for JDK BEANBOX Documentation Examples
19
Introduction to BeanBox See tutorialtutorial Located in bdk\beanbox directory Shell scripts to start run.bat or run.sh Or use make facility (Unix gmake, Windows nmake)
20
BeanBox Three Windows Toolbox: available beans Beanbox: wire beans Properites Sheet: Properties of currently selected beans
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.