Java Beans. Definitions A reusable software component that can be manipulated visually in a ‘builder tool’. (from JavaBean Specification) The JavaBeans.

Slides:



Advertisements
Similar presentations
Copyright © 2001 Qusay H. Mahmoud JavaBeans An introduction to component-based development in general Introduction to JavaBeans – Java components – client-side.
Advertisements

Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
1 Chapter 7 Graphics and Event Handling. 2 Overview The java.awt and javax.swing packages and their subpackages support graphics and event handling. Many.
Java Beans & Serialization CS-328 Dick Steflik. Java Beans Java based component technology –originally developed to provide java with a component technology.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
JavaBeans introduction Klaus-Peter Heidrich for the University of Karlstad Inst. for Information Technology Dept. of Computer Science.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.
By Dr. Jiang B. Liu 12. The Java Beans. Java Beans n JavaBeans is a portable, platform-independent software component model written in Java. It enables.
JavaBeans A component architecture. What is JavaBeans? NC World (New Computing) Dictionary: JavaBeans n. 1. JavaSoft technology. 2. Component object model.
JAVA BEANS By Madhuri Kakumanu. What is a Java Bean? “ A Java Bean is a reusable software component that can be visually manipulated in builder tools.”
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
M.Sc. Course, Dept. of Informatics and Telecommunications, University of Athens S.Hadjiefthymiades “Web Application Servers” Basics on WAS WAS are necessary.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Introducing JavaBeans Lesson 2A / Slide 1 of 30 JDBC and JavaBeans Pre-assessment Questions 1.Which of the given symbols is used as a placeholder for PreparedStatement.
Introducing JavaBeans Identify the features of a JavaBean Create and add a bean to an application Manipulate bean properties using accessor and mutator.
Java Beans.  Java offers software component development through java Beans  Java Beans are based on a software component model for java.  The model.
Java Beans Component Technology Integrated, Visual Development Environments Reusable Platform-Independent Modular.
Component-Based Software Engineering Introduction to Java Beans Paul Krause and Sotiris Moschoyiannis.
Java Beans.
Microsoft Visual Basic 2005: Reloaded Second Edition
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
Chapter 1: An Introduction to Visual Basic 2005 Programming with Microsoft Visual Basic 2005, Third Edition.
SWE 316: Software Design and Architecture Objectives Lecture # 19 Java Beans SWE 316: Software Design and Architecture  Understand  what JavaBeans (“Beans”)
Java Programming: From Problem Analysis to Program Design, Second Edition1  Learn about basic GUI components.  Explore how the GUI components JFrame,
Last update October 18, 2004 Advanced Programming 2004 Java Beans.
JavaBeans Components. To understand JavaBeans…  Proficient experience with the Java language required  Knowledge of classes and interfaces  Object-Oriented.
TM Introduction to JavaBeans™ Dimitrios Psarros Questra Consulting (716) x225.
CompSci 230 S Software Construction Frameworks & GUI Programming.
Hyper/J and Concern Manipulation Environment. The need for AOSD tools and development environment AOSD requires a variety of tools Life cycle – support.
Selected Topics in Software Engineering - Distributed Software Development.
1 First BlueJ Day, Houston, Texas, 1st March 2006 Writing BlueJ Extensions Ian Utting University of Kent.
Java Programming: Advanced Topics 1 JavaBeans Chapter 8.
Components Components are specialized self contained Software entities that can be replicated, Customized and inserted into applications. Components come.
Java Bean Definition “A Java Bean is a reusable software component that can be manipulated visually in a builder tool.”
1 CSC 222: Object-Oriented Programming Spring 2012 netBeans & GUIBuilder  netBeans IDE create/edit/run a project  GUIBuilder JFrame, JButton, JTextField,
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Introduction to Java Beans CIS 421 Web-based Java Programming.
Introduction to Java 120 February 2004Sifei HE © 2004 Introduction to Java for CS381, EE4.Web By Sifei HE Department of Computing.
First Bean Compose SimpleBean Demo Simple Bean Discuss Manifest and Jar Add Properties to SimpleBean.
First Bean Compose SimpleBean Demo Simple Bean Discuss Manifest and Jar Add Properties to SimpleBean.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Intro to Applets. Applet Applets run within the Web browser environment Applets bring dynamic interaction and live animation to an otherwise static HTML.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 27 JavaBeans and.
Intelligent Agent Framework1 From Chapter 7 of Constructing Intelligent Agents with Java.
Class Builder Tutorial Presented By- Amit Singh & Sylendra Prasad.
JAVA BEANS JSP - Standard Tag Library (JSTL) JAVA Enterprise Edition.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Oracle Forms Oracle Forms Builder provides various tools, which have powerful Graphical User Interfaces (GUI's) to design such forms. All objects, properties,
JavaBean Component Java bean is a reusable software component that can be manipulated visually in a builder tool Graphic bean and Non-graphic bean Javabean.
Introduction to Java Beans From Anders Børjesson.
Introduction to Software Components: the JavaBeans specs Babak Esfandiari.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 32 JavaBeans and Bean.
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
Java Beans THETOPPERSWAY.COM. Contents What is a Java Bean? Advantages Properties Bean Developers Kit (BDK) What makes Bean possible? Support for Java.
Overview of Previous Lesson(s) Over View 3 Program.
Java Beans - Basics CIS 421 Web-based Java Programming.
Integrating and Extending Workflow 8 AA301 Carl Sykes Ed Heaney.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Chapter 32 JavaBeans and Bean Events
CSC 222: Object-Oriented Programming
Working in the Forms Developer Environment
Chapter 36 JavaBeans and Bean Events
CompSci 230 S Software Construction
Java Beans Sagun Dhakhwa.
COSC-4840 Software Engineering
Reusability 11/29/2018© 2006 ITT Educational Services Inc.
Pre-assessment Questions
Knowledge Byte In this section, you will learn about:
Component-Based Software Engineering
Java Programming: Advanced Topics
Presentation transcript:

Java Beans

Definitions A reusable software component that can be manipulated visually in a ‘builder tool’. (from JavaBean Specification) The JavaBeans API provides a framework for defining reusable, embeddable, modular software components.

Intro to JavaBeans What are JavaBeans? Software components written in Java Connect and Configure Components Builder Tools allow connection and configuration of Beans Begins ‘Age of Component Developer’ Bringing Engineering methods to Software Engineering (e.g. electronics…)

The JavaBeans API Features implemented as extensions to standard Java Class Library Main Component Services GUI merging Persistence Event Handling Introspection Application Builder Support

User Interface Merging Containers usually have Menus and/or toolbars Allows components to add features to the menus and/or toolbars Define mechanism for interface layout between components and containers

Persistence Components can be stored and retrieved Default – inherit serialization Can define more complex solutions based on needs of the components

Event Handling Defines how components interact Java AWT event model serves as basis for the event handling API’s Provides a consistent way for components to interact with each other

Introspection Defines techniques so components can expose internal structure at design time Allows development tools to query a component to determine member variables, methods, and interfaces Standard naming patterns used Based on java.lang.reflect

Application Builder Support Provides support for manipulating and editing components at design time Used by tools to provide layout and customizing during design Should be separate from component Not needed at run time

Creating a JavaBean Requirements for a simple Bean Packaging Bean in a JAR file Additional Information – BeanInfo Defining property editors Defining Bean customizers Naming Conventions

Bean NON Requirements No Bean Superclass Visible interface not required ‘Invisible’ Beans (timer, random number generator, complex calculation)

Bean Requirements Introspection Exports: properties, methods, events Properties Subset of components internal state Methods Invoked to execute component code Events (If any needed) Notification of a change in state User activities (typing, mouse actions, …)

Bean Requirements Customization Developer can change appearance Persistence Save current state so it can be reloaded

Other properties Indexed properties Array value with get and set elements Bound properties Triggers event when value changed Constrained properties Triggers event when value changes and allows listeners to ‘veto’ the change

BeanInfo class Provides more information using FeatureDescripter objects Subclasses: BeanDescripter, PropertyDescripter, IndexedPropertyDescripter, EventSetDescripter, MethodDescripter, ParameterDescripter

BeanInfo class ICON to represent Bean Customizer Class (wizard for set up) Property Editor references List of properties with descriptions List of methods with descriptions Method to reset properties to defaults

The beanbox Primary task is setting property values Property editors for common types Set Font Set background/foreground colors Set numeric values Set string values

Creating a Bean Usually extends Canvas (New window) Can extend Component (‘lightweight’) Needs constructor with no arguments Paint() method used to display getPreferredSize(), getMinimumSize() For layout manager defaults get and set methods for each property

Packaging the Bean Create a JAR file (JavaARchive) Patterned after tar utility Create ‘stub’ manifest Name: smith/proj/beans/BeanName.class Java-Bean: True (forward slashes even under Windows!)

Some Naming Conventions Beans Class name:any Constructor: no argument or serialized template file Packaging: jar file with Java-Bean: True

More Naming Conventions Properties Get and set using property name Property name: message  public String getMessage()  Public void setMessage(String s)

More Naming Conventions Events Event name: Answer  Class name: AnswerEvent  Listener name: AnswerListener  Listener methods: public void methodname(AnswerEvent e) public void addAnswerListener(AnswerListener l) public void removeAnswerListener(… l)