Introducing JavaBeans Identify the features of a JavaBean Create and add a bean to an application Manipulate bean properties using accessor and mutator.

Slides:



Advertisements
Similar presentations
Bringing Procedural Knowledge to XLIFF Prof. Dr. Klemens Waldhör TAUS Labs & FOM University of Applied Science FEISGILTT 16 October 2012 Seattle, USA.
Advertisements

Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Copyright © 2001 Qusay H. Mahmoud JavaBeans An introduction to component-based development in general Introduction to JavaBeans – Java components – client-side.
Component Oriented Programming 1 Chapter 2 Theory of Components.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Automating Tasks With Macros
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.
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
11 3 / 12 CHAPTER Databases MIS105 Lec14 Irfan Ahmed Ilyas.
Java Programming, 3e Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
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.”
J2EE Java 2 Enterprise Edition. Relevant Topics in The Java Tutorial Topic Web Page JDBC orial/jdbc
Eyad Alshareef 1 Creating Custom Forms Part A. 2Eyad Alshareef Data Block and Custom Forms Data block form Data block form Based on data blocks that are.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Introduction To Form Builder
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
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.
Chapter 3 Software Two major types of software
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.
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.
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
1 Integrated Development Environment Building Your First Project (A Step-By-Step Approach)
Java Beans.
 2002 Prentice Hall. All rights reserved. 1 Introduction to Visual Basic.NET,.NET Framework and Visual Studio.NET Outline 1.7Introduction to Visual Basic.NET.
Microsoft Visual Basic 2005: Reloaded Second Edition
Chapter 10 Introduction to Components. Process Phases Discussed in This Chapter Requirements Analysis Design Implementation ArchitectureFramework Detailed.
Using JavaBeans and Custom Tags in JSP Lesson 3B / Slide 1 of 37 J2EE Web Components Pre-assessment Questions 1.The _____________ attribute of a JSP page.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
SWE 316: Software Design and Architecture Objectives Lecture # 19 Java Beans SWE 316: Software Design and Architecture  Understand  what JavaBeans (“Beans”)
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
Learning objectives By the end of this lecture you should be able to:  have a well-earned rest! Ch 24 Beyond the second semester.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
Chapter 8 Introduction to HTML and Applets Fundamentals of Java.
CHAPTER TEN AUTHORING.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
CHAPTER TWO INTRODUCTION TO VISUAL BASIC © Prepared By: Razif Razali 1.
Java Programming: Advanced Topics 1 JavaBeans Chapter 8.
SWE 316: Software Design and Architecture Objectives Lecture # 18 Introduction to Components SWE 316: Software Design and Architecture To learn:  benefits.
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.”
Introduction to Java Beans CIS 421 Web-based Java Programming.
Copyright © Mohamed Nuzrath Java Programming :: Syllabus & Chapters :: Prepared & Presented By :: Mohamed Nuzrath [ Major In Programming ] NCC Programme.
Microsoft Visual Basic 2008 CHAPTER ELEVEN Multiple Classes and Inheritance.
Java Beans. Definitions A reusable software component that can be manipulated visually in a ‘builder tool’. (from JavaBean Specification) The JavaBeans.
Intelligent Agent Framework1 From Chapter 7 of Constructing Intelligent Agents with Java.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 10 1 Microsoft Office Access 2003 Tutorial 10 – Automating Tasks With Macros.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Reading Flash. Training target: Read the following reading materials and use the reading skills mentioned in the passages above. You may also choose some.
Advanced Java Session 4 New York University School of Continuing and Professional Studies.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
Getting Started with.NET Getting Started with.NET/Lesson 1/Slide 1 of 31 Objectives In this lesson, you will learn to: *Identify the components of the.NET.
Introduction to Software Components: the JavaBeans specs Babak Esfandiari.
Java Beans THETOPPERSWAY.COM. Contents What is a Java Bean? Advantages Properties Bean Developers Kit (BDK) What makes Bean possible? Support for Java.
Introduction to Visual Basic. NET,. NET Framework and Visual Studio
Creating a Flash Web Site
Chapter 2 – Introduction to the Visual Studio .NET IDE
Java Beans Sagun Dhakhwa.
CIS16 Application Development Programming with Visual Basic
JavaServer Faces: The Fundamentals
Pre-assessment Questions
Knowledge Byte In this section, you will learn about:
Java Programming: Advanced Topics
Presentation transcript:

Introducing JavaBeans Identify the features of a JavaBean Create and add a bean to an application Manipulate bean properties using accessor and mutator methods

Introducing JavaBeans Getting Started Object Is a runtime instance of a class Software components: Are reusable objects Pluggable into any software application from any vendor Examples - Spell-check utility, find and replace utility JavaBeans Are reusable and self-contained software components created using Java

Introducing JavaBeans Getting Started (Contd.) JavaBeans – Development Phases: Construction phase Involves creation of a JavaBean and its user interface Build phase Involves placing the JavaBean into the target container Execution Phase Involves execution of the the container application in which the JavaBean is placed

Introducing JavaBeans Getting Started (Contd.) 3 Construction Phase involves creation of the following: ä.class files ä.mft file ä.jar file *Elements of a JavaBean 3 Properties ä Are the private member data contained in a JavaBean

Introducing JavaBeans Getting Started (Contd.) 3Methods ä Are the public member functions used to: ä Manipulate bean properties ä Expose bean functionality 3Events ä Are used to communicate changes in bean property values or changes in its state to other beans

Introducing JavaBeans Getting Started (Contd.) *The JavaBean Component Specification 3Customization ä Is the ability of a JavaBean to allow its properties to be changed 3Persistence ä Is the ability of a bean to save its state 3Communication ä Is the ability of a bean to inform changes in its attributes to other beans and to the container application

Introducing JavaBeans Getting Started (Contd.) Introspection Is the ability of a bean to be queried by external applications Types of JavaBeans Bean typeDescription Control beansAre used to create graphical user interface components Container beansAre used to hold other Java beans Invisible Runtime beans Are used to create components that perform a specific task in the background

Introducing JavaBeans Building an Application Using Existing Beans To identify the software to be used to build and test the components and familiarize yourself with the software by creating an application similar to the one shown below:

Introducing JavaBeans Task List Identify the software to be used to create the application Identify the beans to be added to the BeanBox window Add the beans to the BeanBox window Associate events with the beans Save and execute the application

Introducing JavaBeans Task 1: Identify the software to be used to create the application Beans Development Kit Is used as a tool to: Build bean based applications Test bean functionality Contains several example beans To start BDK Execute the run.bat file from the command prompt.

Introducing JavaBeans Task 1: Identify the software to be used to create the application (Contd.) The following windows appear on starting BDK: Window nameDescription ToolBoxContains a list of sample beans supplied with BDK BeanBoxActs as a form or a container for the beans that make up an application PropertiesDisplays the properties of the bean currently selected in the BeanBox window Method TracerKeeps track of method invocations across beans

Introducing JavaBeans Task 1: Identify the software to be used to create the application (Contd.) Result: BDK will be used to test the beans

Introducing JavaBeans Task 2: Identify the beans to be added to the BeanBox Result: The application uses two beans that are supplied with the BDK software Juggler bean Two instances of the OurButton bean

Introducing JavaBeans Task 3: Add the beans to the BeanBox window Task 4: Associate events with the beans Task 5: Save and execute the application

Introducing JavaBeans ä The Juggler bean is an example of a ____ type of bean. ä Which window of BDK is used to change the background color of a bean? ä Which window of BDK is used to build a bean application?

Introducing JavaBeans Creating Beans and Building Applications A customer can access his account only after entering the pin number. You need to construct and test the component for the ATM application. The specifications for the component are given below: 3It should display the logo of the bank as an animation. You might plug in the login component into the ATM application of any bank. So, the logo should be modifiable according to the ATM application of a particular bank into which the component is plugged in 3It should accept the pin number of a customer

Introducing JavaBeans Creating Beans and Building Applications (Contd.) 3It should contain a method that checks if the pin number entered by a customer is present in the Earnest Bank database. This feature is specific to the Earnest Bank ATM application After you create the login component, build a sample application and test the functionality of the component. The user interface of the sample login application should look similar to the one shown:

Introducing JavaBeans Creating Beans and Building Applications (Contd.) The user interface of the sample login application should look similar to the one shown:

Introducing JavaBeans Task List *Identify the controls to be used *Identify the properties to be exposed by the bean *Identify the methods to be supported by the bean *Create the User Interface of the bean *Add code to expose the bean properties *Code the methods to be supported by the bean *Save and compile the program *Create the.mft file *Create the.jar file

Introducing JavaBeans Task List *Load the bean into BDK *Build an application using the bean *Execute the application and verify the functionality of the bean

Introducing JavaBeans Task 1: Identify the controls to be used Result: 3The controls to be used are: ä A label and text field control for accepting the pin number ä A label control for displaying the bank logo

Introducing JavaBeans Task 2: Identify the properties to be exposed by the bean Result: 3The logo property should be exposed

Introducing JavaBeans Task 3: Identify the methods to be supported by the bean Result: 3A method named validatePinNo()needs to be coded in the component Task 4: Create the User Interface of the bean

Introducing JavaBeans Task 5: Add code to expose the bean properties *Properties of a Bean: 3Are the characteristics of a bean 3Are used to change the appearance and behavior of a bean 3Example: ä Properties that have to be exposed by a spell check utility can be coded as: private String language; private String dictionaryPath;

Introducing JavaBeans Task 5: Add code to expose the bean properties (Contd.) *Accessor and Mutator Methods 3Are used to make the properties of a bean available to the outside world 3Are used to ensure the integrity of bean data *get method ä Allows the current value of a property to be read *set method ä Allows the current value of the property to be changed

Introducing JavaBeans Task 6: Code the methods to be supported by the bean Task 7: Save and compile the program

Introducing JavaBeans Task 8: Create the.mft file *The Manifest file: 3Is used by the target application to recognize a JavaBean 3Is saved with a.mft extension 3Contains a list of all class files that make up a JavaBean

Introducing JavaBeans Task 9: Create the.jar file *The JAR file: 3Is similar to a zip file 3Is used to package a JavaBean for distribution 3Contains the manifest file and all other files such as the class files and picture files of the bean 3Has a.jar extension

Introducing JavaBeans Task 10: Load the bean into BDK Task 11: Build an application using the bean Task 12: Execute the application and verify the functionality of the bean

Introducing JavaBeans Creating Beans and Building Applications(try out) A component needs to be created that accepts the login id and password of a customer. The component should wait for 30 seconds before the user enters the login information. The code for the component is given below. You need to modify the code to do the following: If the user does not login for the specified time, a login time out message should be displayed The time out message to be displayed will be specified during the build phase The component should be pluggable into the ATM application of any bank

Introducing JavaBeans An object is a run-time instance of a class. A component is a reusable object that can be embedded into any software application from any vendor. The SpellCheck utility is an example of a component Beans created using Java takes advantage of all the security and platform independent features of Java A JavaBean exists in one of the following three phases: the construction phase, the build phase, and the execution phase

Introducing JavaBeans As per the JavaBean Component Specification, a simple Java object must support the following five features for it to become a JavaBean: 3Properties 3Customization 3Persistence 3Communication 3Introspection

Introducing JavaBeans *You can create three types of beans: 3Control beans 3Container beans 3Invisible run-time beans *A wide variety of application development environments such as Forte For Java, IBM Visual Age, Kawa, Beans Development Kit (BDK) and Symantec Visual Cafe are available in the market that support the creation, building, and testing of Java beans *BDK can be used as build tool to build bean applications or as a testing tool to test the beans for their intended functionality

Introducing JavaBeans  Execute the run.bat file from the command prompt to start BDK  On starting BDK, the ToolBox palette, the BeanBox window, and the Properties window are displayed  BDK consists of several re-usable sample beans such as the Juggler bean and the OurButton bean *Properties are the characteristics of a bean and are similar to the data members of a class. By changing the properties, you can change the appearance and behavior of a bean *The get and set accessor methods are used to expose the bean properties to external applications

Introducing JavaBeans  The manifest file contains information about a bean such as the name of the bean and the files present in the. jar file of the bean  JavaBeans are packaged and distributed as. jar files