Java Beans-Java Network Programming-Lecture Slides, Slides of Java Programming

This lecture is delivered by Prem Vikas at Jaypee Institute of Information Technology University for discussing following points of Java Network Programming: Java, Beans, Component, Technology, Limitations, Need, Platform, Independent, Microsoft

Typology: Slides

2011/2012

Uploaded on 07/03/2012

aapti
aapti 🇮🇳

4.6

(28)

80 documents

1 / 19

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Java
ava-programming
An
Introduction
Java Short Course
Day-14
J
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13

Partial preview of the text

Download Java Beans-Java Network Programming-Lecture Slides and more Slides Java Programming in PDF only on Docsity!

Java

ava - programming

An Introduction

Java Short Course Day-

J

Java

Today’s Lecture

o Java Beans

o Concepts

 Component Technology  JavaBeans

Java

Examples

Java

Component Software-

o Microsoft Component Technologies

 COM

 COM+

 DCOM

 OLE

 OLE

Java

Java Beans

o JavaBeans  implemented as an architecture-independent and platform-independent Application Programming Interface (API) for creating and using dynamic Java software components

o Mission Statement at JavaSsoft  Write once, run anywhere, reuse everywhere  Write Once  Changes are not required to add up the functionalities, new features can be added, old features can be enhanced, but features are not dependent on each other  Run Anywhere  Cross platform execution along with support for distributed computing  Reuse Everywhere  In websites, applications, documents, where supported We will explore the architecture of Java Beans in rest of the lecture and will try to understand how JavaBeans fulfills its claim

Java

Meeting Goals

o Java Beans should be

 Compact and easy to create and use  Compact is required for the transfer of components over the network  Applet APIs are already in used at browsers and are proven efficient in terms of size and execution  Fully portable  The JavaBeans API, coupled with the platform-independent Java system on which it is based, creates the platform-independent component solution  Flexible design-time component editor support  The JavaBeans architecture includes support for specifying design- time properties and editing mechanisms to facilitate visual editing of JavaBeans components  Leverage for robust distributed computing mechanisms  Java Solutions, RMI, CORBA, DCOM support or any other

Java

Structure of Java Bean-

o Data / Methods Access  Public, Protected, Private  Just like a Java Class

o Interfaces  A bean provides access to its functionality by means of interfaces  Public Methods of a Bean define interfaces

Protected Methods

Private Methods

Public Methods

Data

Interface A Interface B

Java

Using Beans with Builder Tools

o Builder Tools are to be purchased for the Beans to be used.

 Beans are used in specific Builder Tools

o Using Beans

 Visually lay out the application, using beans where appropriate.  Customize the beans using visual property editors.  Connect the beans using the builder tool's facilities, and write event- handler code.  Package the application with the beans and share it with the world.

o Ease of Use

 Provided by builder tool  The builder tool communicates with bean using beans interfaces  So ease of use is provided by the bean’s architecture

Java

Java Beans API

o The complex functionality of JavaBeans is handled by means of JavaBeans API  java.beans package is also referred to as JavaBeans API  The technology JavaBeans is an interface and the functionalities are implemented by means of JavaBeans API

o Important Component Services provided by JavaBeans API  Property management  Introspection  Event handling  Persistence  Application builder support

By understanding these services and how they work, you'll have much more insight into exactly what type of technology JavaBeans is

Java

Property Management-

o The property management facilities in the JavaBeans API are responsible for handling all interactions relating to bean properties

o Properties are discrete, named attributes of a bean that determine its appearance and behavior

o Properties are important in any component technology because they isolate component state information into discrete pieces that can be easily modified.

o Example: How beans properties are accessed and used

 Can be accessed scripting environments such as JavaScript or VBScript (as object field)  Programmatically, using public accessor methods  Visually, using property sheets in application builder tools

Java

Property Mangement-

o Constrained Properties

o Introspection (Look inside a bean)

 Services for revealing the beans structure, primarily for Builder tools  Low Level Services: For builder tools to access the internal structure of bean either public or private, necessary for communication with bean  High Level Services: For developer, provide access to the public properties of beans, use for builder for providing Visual Property Editor

o Reflection and Design Patterns

 Accessing public properties of a Bean is done by means of low level reflection services  These services gather information about a bean and determine its public properties, methods, and events by applying simple design patterns.  Design patterns are set of consistent rules or conventions

Java

Creating Beans

Designing a Bean

Installing the BDK

Testing Beans with the BeanBox Test Container

Packaging Beans with JAR Files

Java

Bean Requirements

o Introspection

 Exports: properties, methods, events

o Properties

 Subset of components internal state

o Methods

 Invoked to execute component code

o Events (If any needed)

 Notification of a change in state  User activities (typing, mouse actions, …)

o Customization

 Developer can change appearance

o Persistence

 Save current state so it can be reloaded