Component-Based Software Engineering Introduction to Java Beans Paul Krause and Sotiris Moschoyiannis.

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

Component Oriented Programming 1 Chapter 2 Theory of Components.
Database Systems: Design, Implementation, and Management Tenth Edition
JavaBeans: Introspection and Customization Umer Farooq CS6704: Design Patterns & Component FrameworksJanuary 30, 2002.
Lecture Roger Sutton CO331 Visual Programming 1: Module introduction and the programming environment 1.
Java Beans & Serialization CS-328 Dick Steflik. Java Beans Java based component technology –originally developed to provide java with a component technology.
JavaBeans introduction Klaus-Peter Heidrich for the University of Karlstad Inst. for Information Technology Dept. of Computer Science.
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.”
Software Engineering Module 1 -Components Teaching unit 3 – Advanced development Ernesto Damiani Free University of Bozen - Bolzano Lesson 2 – Components.
Page 1 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Chapter 4 Component Models and Technology.
Structure of a web application1 Dr Jim Briggs. MVC Structure of a web application2.
M.Sc. Course, Dept. of Informatics and Telecommunications, University of Athens S.Hadjiefthymiades “Web Application Servers” Basics on WAS WAS are necessary.
1. 2 Chapter 1 Introduction to Computers, Programs, and Java.
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.
Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc
 1. Introduction  2. Development Life-Cycle  3. Current Component Technologies  4. Component Quality Assurance  5. Advantages and Disadvantages.
Arc: Programming Options Dr Andy Evans. Programming ArcGIS ArcGIS: Most popular commercial GIS. Out of the box functionality good, but occasionally: You.
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
Java Beans.
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
Replication & EJB Graham Morgan. EJB goals Ease development of applications –Hide low-level details such as transactions. Provide framework defining the.
Enterprise JavaBeans. What is EJB? l An EJB is a specialized, non-visual JavaBean that runs on a server. l EJB technology supports application development.
|Tecnologie Web L-A Anno Accademico Laboratorio di Tecnologie Web Introduzione ad Eclipse e Tomcat
Last update October 18, 2004 Advanced Programming 2004 Java Beans.
Introduction to Java Beans by Anders Børjesson. Introduction to JavaBeans2 JavaBeans components JavaBeans are the components in the Java environment Many.
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.
Comparing JavaBeans and OSGi Towards an Integration of Two Complementary Component Models HUMBERTO CERVANTES JEAN-MARIE FAVRE 09/02.
Introduction into component programming based on Java beans Dušan Tošić
Selected Topics in Software Engineering - Distributed Software Development.
Java Programming: Advanced Topics 1 JavaBeans Chapter 8.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
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,
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.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 13. Review Shared Data Software Architectures – Black board Style architecture.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 27 JavaBeans and.
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.
CSE 332: Design Patterns Review: Design Pattern Structure A design pattern has a name –So when someone says “Adapter” you know what they mean –So you can.
1 Service Creation, Advertisement and Discovery Including caCORE SDK and ISO21090 William Stephens Operations Manager caGrid Knowledge Center February.
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.
Plug-in Architectures Presented by Truc Nguyen. What’s a plug-in? “a type of program that tightly integrates with a larger application to add a special.
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
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.
Lorenz: Visitor Beans: An Aspect-Oriented Pattern Aspect-oriented pattern: describes a solution to a tangling problem in a particular context.
Java Programming: Advanced Topics1 Introduction to Advanced Java Programming Chapter 1.
Java Beans THETOPPERSWAY.COM. Contents What is a Java Bean? Advantages Properties Bean Developers Kit (BDK) What makes Bean possible? Support for Java.
Integrating and Extending Workflow 8 AA301 Carl Sykes Ed Heaney.
Chapter 32 JavaBeans and Bean Events
Structure of a web application
Chapter 36 JavaBeans and Bean Events
Chapter 1 Introduction to Computers, Programs, and Java
Introduction to Advanced Java Programming
Java Beans Sagun Dhakhwa.
Component-Based Software Engineering
Java Programming: Advanced Topics
Presentation transcript:

Component-Based Software Engineering Introduction to Java Beans Paul Krause and Sotiris Moschoyiannis

Java Beans Contents  Definition  Bean Basics

What is a Java Bean?  “A Java Bean is a reusable software component that can be manipulated visually in a builder tool” JavaSoft

Sources of Builder Tools  NetBeans:  JBuilder:  Note, you also need to have the Java SDK installed.

Bean Books Developing Java Beans Robert Englander O’ReillyRecommended JavaBeans Programming J. O’Neil and H. Schildt McGraw Hill Good. Contains many examples. JavaBeans by Example Henri Jubin Prentice Hall Simpler than the above, but with useful examples NetBeans – the Definitive Guide Boudreau, Glick, Greene, Spurlin, Woehr O’Reilly Not so good on Beans. More about the IDE.

Java Beans Contents  Definition  Bean Basics

The Component Model  JavaBeans is Java’s component model  The model is made up of an architecture and an API  The API makes it possible to write component software in Java  The architecture provides the framework (services and rules) that allows components to participate properly

The Component Model  Discovery and Registration  Raising and Handling of Events  Persistence  Visual Presentation  Support for Visual Programming

The Component Model  Discovery and Registration Locate a component at run-time and determine its supported interfaces Locate a component at run-time and determine its supported interfaces Registration process for a component to make itself and its interfaces known Registration process for a component to make itself and its interfaces known This mechanism allows components and applications to be developed independently

The Component Model  Raising and Handling of Events Beans (or JavaBeans components) use events to communicate with other Beans Beans (or JavaBeans components) use events to communicate with other Beans A Bean that wants to receive events (a listener Bean) registers its interest with the Bean that triggers the event (a source Bean) A Bean that wants to receive events (a listener Bean) registers its interest with the Bean that triggers the event (a source Bean)

The Component Model  Persistence Persistence enables Beans to save and restore their state Persistence enables Beans to save and restore their state JavaBeans uses Java Object Serialization to support persistence JavaBeans uses Java Object Serialization to support persistence

The Component Model  Visual Presentation The Bean is free to choose its own visual presentation (fonts, colours, shape, etc) The Bean is free to choose its own visual presentation (fonts, colours, shape, etc) Many of these characteristics will be properties of the Bean (some might be persistent too) Many of these characteristics will be properties of the Bean (some might be persistent too)

The Component Model  Support of Visual Programming User can select a component from the toolbox and place it into a container User can select a component from the toolbox and place it into a container Properties of the component can then be edited to create the desired behaviour Properties of the component can then be edited to create the desired behaviour

Bean’s Properties  Properties are a Bean’s appearance and behaviour characteristics that can be changed at design time  By following specific naming conventions, the properties of a Bean that are “revealed” to the world can be identified

Conventions for Access Methods  Simple Properties: For a property of type Type and name Name: For a property of type Type and name Name: public Type getName( ); public Type getName( ); public void setName(Type value); public void setName(Type value);  Boolean Properties: public boolean isName( ); public boolean isName( ); public void setName(boolean value); public void setName(boolean value);

Bean Methods  A Bean may be implemented by a Java Class  That Class contains a number of methods that may be used to access and control the Bean  These are generally all the public methods of the Class that implements the Bean

Events  JavaBeans components interact by generating “Events”  Several components may register an interest in an Event that is generated by a specific component  Occurrence of the Event triggers methods to be called in all the components that are “listening” for it

Introspection  The process by which builder tools discover a Bean’s features  Beans support introspection in two ways: By adhering to specific rules (design patterns) By adhering to specific rules (design patterns) when naming properties, methods and events when naming properties, methods and events By explicitly providing property, method and By explicitly providing property, method and event info within a Bean Information class event info within a Bean Information class

Introspection  Low-level reflection: Follow Bean coding style (we have seen) Follow Bean coding style (we have seen) Analysis of the Bean’s class can then reveal properties and methods Analysis of the Bean’s class can then reveal properties and methods  Revealing complex properties: Implement a “BeanInfo” class Implement a “BeanInfo” class

Customisation  Beans expose properties so they can be customised at design time  Customisation is supported in two ways: By using property editors By using property editors By creating more sophisticated Bean customisers By creating more sophisticated Bean customisers

Customisation  Simple properties Development tool will build property sheets dynamically Development tool will build property sheets dynamically User may then edit the properties to customise the Bean User may then edit the properties to customise the Bean  For the Advanced User Create a specific customiser for a Bean Create a specific customiser for a Bean This is kept separate to the Bean Class, as with a BeanInfo Class This is kept separate to the Bean Class, as with a BeanInfo Class

Further Features  Visibility It is not necessary for a Bean to be visible at run-time (e.g. Bean controlling access to a device or data feed) It is not necessary for a Bean to be visible at run-time (e.g. Bean controlling access to a device or data feed) It is necessary however for a Bean to support the visual builder tool. Even an ‘invisible’ run- time Bean shall be shown on the builder tool It is necessary however for a Bean to support the visual builder tool. Even an ‘invisible’ run- time Bean shall be shown on the builder tool

Further Features  Multithreading Always assume your code will be used in a multithreaded environment Always assume your code will be used in a multithreaded environment Make sure that your Beans are thread-safe Make sure that your Beans are thread-safe Multithreading in JavaBeans is no different than multithreading in Java Multithreading in JavaBeans is no different than multithreading in Java

Further Features  Security By default assume that your Beans are running in a non-trusted applet By default assume that your Beans are running in a non-trusted applet Apply security restrictions such as Apply security restrictions such as Allow no access to the local file systemAllow no access to the local file system Limit socket connections to the host systemLimit socket connections to the host system

Summary  Beans build on Java features that already exist  We add a Builder Tool  We use design patterns  We record information about the Classes that implement Beans