Lorenz: Visitor Beans: An Aspect-Oriented Pattern Aspect-oriented pattern: describes a solution to a tangling problem in a particular context.

Slides:



Advertisements
Similar presentations
TSpaces Services Suite: Automating the Development and Management of Web Services Presenter: Kevin McCurley IBM Almaden Research Center Contact: Marcus.
Advertisements

COMP 121 Week 9: AbstractList and ArrayList. Objectives List common operations and properties of Lists as distinct from Collections Extend the AbstractCollection.
Copyright © 2001 Qusay H. Mahmoud JavaBeans An introduction to component-based development in general Introduction to JavaBeans – Java components – client-side.
Remote Method Invocation
The road to reliable, autonomous distributed systems
Introduction to Jini & JavaSpaces
Notes to the presenter. I would like to thank Jim Waldo, Jon Bostrom, and Dennis Govoni. They helped me put this presentation together for the field.
Java Beans & Serialization CS-328 Dick Steflik. Java Beans Java based component technology –originally developed to provide java with a component technology.
Principles of Object-Oriented Software Development The language Java.
Copyright W. Howden1 Lecture 19: Intro to O/O Components.
JavaBeans introduction Klaus-Peter Heidrich for the University of Karlstad Inst. for Information Technology Dept. of Computer Science.
JavaBeans A component architecture. What is JavaBeans? NC World (New Computing) Dictionary: JavaBeans n. 1. JavaSoft technology. 2. Component object model.
Network Management with JMX Thu Nguyen Oliver Argente CS158B.
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.”
Dynamic layout of Distributed Applications in FarGo Ophir Holder Israel Ben-Shaul Hovav Gazit.
1 FM Overview of Adaptation. 2 FM RAPIDware: Component-Based Design of Adaptive and Dependable Middleware Project Investigators: Philip McKinley, Kurt.
M.Sc. Course, Dept. of Informatics and Telecommunications, University of Athens S.Hadjiefthymiades “Web Application Servers” Basics on WAS WAS are necessary.
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 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.
CSCI 6962: Server-side Design and Programming Web Services.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
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.
CIS 644 Aug. 25, 1999 tour of Java. First … about the media lectures… we are experimenting with the media format please give feedback.
Spring Framework. Spring Overview Spring is an open source layered Java/J2EE application framework Created by Rod Johnson Based on book “Expert one-on-one.
LAB 1CSIS04021 Briefing on Assignment One & RMI Programming February 13, 2007.
Comparing JavaBeans and OSGi Towards an Integration of Two Complementary Component Models HUMBERTO CERVANTES JEAN-MARIE FAVRE 09/02.
In the name of Allah The Proxy Pattern Elham moazzen.
New features for CORBA 3.0 by Steve Vinoski Presented by Ajay Tandon.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
Shannon Hastings Multiscale Computing Laboratory Department of Biomedical Informatics.
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.”
Patterns in programming1. 2 What are patterns? Answers to common design problems. A language used by developers –To discuss answers to design problems.
Design Patterns CSIS 3701: Advanced Object Oriented Programming.
Introduction to Java Beans CIS 421 Web-based Java Programming.
First Bean Compose SimpleBean Demo Simple Bean Discuss Manifest and Jar Add Properties to SimpleBean.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 27 JavaBeans and.
Virtual Real-time 3D Object Sharing for Supporting Distance Education and Training Hiroko Suzuki Faculty of Computer and Information Science, Hosei University,
Proxy.
Java Beans. Definitions A reusable software component that can be manipulated visually in a ‘builder tool’. (from JavaBean Specification) The JavaBeans.
Demeter Aspects We study techniques for the emerging area of Aspect-Oriented Software Development and focus on the following areas:  Aspectual Collaborations.
OO Methodology Elaboration Iteration 2 - Design Patterns -
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.
Advanced Java Session 4 New York University School of Continuing and Professional Studies.
JACQUARD2005, KNVB HOTEL Zeist 3 en 4 februari 2005 Composing Configurable Java Components Tijs van der Storm, CWI, Project Deliver.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
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.
Java Beans THETOPPERSWAY.COM. Contents What is a Java Bean? Advantages Properties Bean Developers Kit (BDK) What makes Bean possible? Support for Java.
Java Beans - Basics CIS 421 Web-based Java Programming.
1 Lecture 15 Remote Method Invocation Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
© 2010 IBM Corporation RESTFul Service Modelling in Rational Software Architect April, 2011.
Chapter 32 JavaBeans and Bean Events
Actions and Behaviours
Chapter 36 JavaBeans and Bean Events
Javabeans for dummies.
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Broker in practice: Middleware
Java Beans Sagun Dhakhwa.
In-situ Visualization using VisIt
Reusability 11/29/2018© 2006 ITT Educational Services Inc.
Pre-assessment Questions
Component-Based Software Engineering
Presentation transcript:

Lorenz: Visitor Beans: An Aspect-Oriented Pattern Aspect-oriented pattern: describes a solution to a tangling problem in a particular context.

AOP = control of tangling Demeter/Java controls the following tangling problems –structure/behavior, –navigation/behavior, –behavior/behavior, –object construction/structure, –synchronization/behavior, –remote invocation/behavior.

Java Bean: a Java class Provides: methods and events Requires: listens to events from other beans –pcs.firePropertyChange("n", old, new)

Java Beans Software Component Model for Java –Introspection: what methods and events are available. Builder tool can inspect a bean. –Support for customization –Events: for communication between beans

Java Beans Three most important features –set of properties it exposes –set of methods it allows other beans to call –set of events it fires event listeners can be associated with event source when the event source detects something, it will call an appropriate method on the event listener object

Java Beans Design-time versus run-time. A bean must be capable of running in a –design environment: design information, customization (code can be large: wizard style customization) –run-time environment

Clear separation:design-time and run-time aspects Design-time interfaces can be supported in a separate class from the run-time interfaces It is possible to deploy a bean at run-time without needing to download all its design time code

Links to remote state Java bean runs in same address space as their container Network access mechanisms available: –Java RMI –Java IDL: CORBA –JDBC: Java data base API

Alternate type views First release: each bean a single Java object Future releases: beans that are implemented as a set of cooperating objects. Type view: represents a view of a bean as a given type In future releases: different type views of a bean may be implemented by different Java objects.

Events Listener Source

Goal Enable discovery of the events that a particular class may generate Enable the discovery of the events a class may observe Common event registration mechanism for dynamic manipulation of relationship between sources and listeners

Design patterns used with a different meaning The standard design pattern for EventListener registration (multicast event source): –public void add ( listener); –public void remove ( listener); should be synchronized methods

Java Beans preferred format public PropertyType get (); // simple getter method public void set (PropertyType var); // simple setter method public PropertyType get (int index); // indexed getter method public void set (int index, PropertyType var); // setter method public PropertyType[] get (); // indexed getter method public void set (PropertyType[] var); // indexed setter method

Defining events and listeners public class ContainerEventObject extends EventObject {…} public interface ContainerListener extends EventListener { void handleContainerEvent(ContainerEventObject ceo); }

Listeners for Container bean private Vector containerListeners = new Vector(); public synchronized void addContainerListener(ContainerListener l) { containerListeners.addElement(l); } public synchronized void removeContainerListener(ContainerListener l){ containerListeners.removeElement(l); }

Broadcasting event public void broadcastContainerEvent() { Vector l; ContainerEventObject ceo = new ContainerEventObject(this); synchronized(this) { l = (Vector)containerListeners.clone(); } for (int i = 0; i < l.size(); i++) { ContainerListener cl = (ContainerListener)l.elementAt(i); cl.handleContainerEvent(ceo); }

Visitor Bean Accept methods: use reflection to define a traversal visitor! Visit methods: Instead of sending a visitor to visit an element, the element is fired to the visitor as part of an event.

In class Visitor public void visit_dispatch(Object o){ Class[] formal = new Class[1]; formal[0] = o.getClass(); try { Method m = getClass().getMethod(“visit”, formal); Object[] actual = new Object[1]; actual[0] = o; m.invoke(this, actual); } catch (Exception e) { } }

Visit events Visitors report their actions via events –event objects may contain visited objects –visitors may register as event listeners to other visitors –Events are typed: registration is typesafe

VisitEvent Package visitor.beans.event; import java.util.EventObject; public class VisitEvent extends EventObject { protected VisitEvent(Object source, int type, Object visited, Object[] data) { super(source); fieldType = type; fieldVisited = visited; fieldData = data; } private transient int fieldType = 0; … }

Visitor kinds Traversal visitors: –manipulate the visitee part and pass data without looking at it Computational visitors: –pass the visitee untouched and manipulate only the data

Adaptive Bean: visitor style Traversal status events (contain objects traversed) out in nodes + edges enter + exit terminate node + edge Local adaptive beans strategy