Hi Brian: >From brapalje@together.net Tue Dec 16 12:18:37 1997 >From: Brian Rapalje >To: "'Karl Lieberherr'" >Cc: "'Brian Rapalje'" >Subject: RE: impressive project >Return-Receipt-To: > >Hello Professor, > >Thanks. If you have any questions feel free to send me a note. >I'd also be willing to help implement further improvements. I appreciate your help in integrating with Demeter/Java. We will involve you in the design decisions. A first question is: how is your beanasp language best integrated with Mike Miller's bean aspect language? http://www.ccs.neu.edu/research/demeter/course/f97/projects/java-beans2 >I'd also like to note that in 'Users Guide' section of my WWW page >I failed to mention that after the Weaver is run some manual editing >of the java file is required (namely making the class public & >making the default constructor public). The manual editing is >described in the 'Iteration 2' section but I failed to include it in the >'Users Guide'. > We will remmber that. > >While studying for the final I also came across the >'A = *extends* java.util.Event .' CD syntax. This should be helpful >with respect to having Demeter/Java Beans generate events other >then the PropertyChangeEvent that is supported by my project. > > -Brian > Karl >---------- >From: Karl Lieberherr >Sent: Tuesday, December 16, 1997 9:34 AM >To: brian.rapalje@acm.org >Subject: impressive project > >Subject: Java Beans project > >Hi Brian: > >your project is impressive! See below for my plans. > >-- Karl > > >------------- >Hi Josh: > >Brian Rapalje's project at URL: > >http://www.ccs.neu.edu/research/demeter/course/f97/projects/java-beans1 > >on the interoperability aspect (Java Beans) is ready for integration with Demeter/Java. Our DARPA >work requires such an interoperability solution. Besides *.beh, *.cd, *.cool and *.ridl files we will >also have *.beanspec files. An example is below: from X.cd, X.beh, X.beanspec, we generate XBean. >asp and XBeanInfo.java. > >For viewing start with file project.html. > >The interoperability aspect has a different flavor than the structure aspect: it is more localized. The >X.beanspec information goes into class X and class XBeanInfo only and is not spread throughout >the program like the structural information. But it is still an aspect, although a less systemic one. >Another difference to the structure aspect is that beanspec information is not duplicated several times >into the target program. It is used once. > >Brian mentions several features which need to be added. He could not express certain changes with >your weaver notation. Does it need an addition? > >I would like you to give a presentation on Java Beans for Demeter/Java >in the second week of January. Please can you prepare for that? >Suggested outline: > >0. Overview of Java Beans. >1. Demonstration of Brian's project: Linking two Demeter/Java generated beans (using a >2. version of Brian's netscape files on my labtop). >2. Interoperability aspect language. >3. Translation to aspect file and BeanInfo file. >4. What needs to be improved? >5. Are their interaction problems with other aspects? > >-- Karl > >Example: > >X.beanspec: >package test1; > >X { > Method : inc > Property : ReadOnly text > Property : Bound ReadWrite n >} > >X.cd: >package test2; > >X = String Integer. > >X.beh: >X { > init (@ > n = new Integer(0); > text = "Hello World"; > @) > > public void inc() (@ > set_n(new Integer(n.intValue()+1)); > @) >} > >generates: > >XBean.asp >core: > >import java.beans.*; >import java.io.*; > >implement: java.io.Serializable in: X; > >add: to: X { > PropertyChangeSupport _pcs = (@ new PropertyChangeSupport(this) @) >} > >add: to: X { > public void addPropertyChangeListener(PropertyChangeListener l) (@ > _pcs.addPropertyChangeListener(l); > @) >} > >add: to: X { > public void removePropertyChangeListener(PropertyChangeListener l) (@ > _pcs.removePropertyChangeListener(l); > @) >} > >before: X.set_n (@ > Object _old = n; >@) > >after: X.set_n (@ > _pcs.firePropertyChange("n", _old, new_n); >@) > >and > >XBeanInfo.java >package test1; > >import java.beans.*; >import java.lang.*; >import java.lang.reflect.*; >import java.util.*; > >public class XBeanInfo extends SimpleBeanInfo { > final static Class beanClass = X.class; > PropertyDescriptor properties[] = new PropertyDescriptor[2]; > EventSetDescriptor eventSet[] = new EventSetDescriptor[1]; > MethodDescriptor methods[] = null; // new MethodDescriptor[1]; > public XBeanInfo() { > try { > properties[0] = new PropertyDescriptor("text", > beanClass, > "get_text", > "set_text"); > properties[1] = new PropertyDescriptor("n", > beanClass, > "get_n", > "set_n"); > String listenerMethods[] = {"propertyChange"}; > eventSet[0] = new EventSetDescriptor(beanClass, > "propertyChange", > PropertyChangeListener.class, > listenerMethods, > "addPropertyChangeListener", > "removePropertyChangeListener"); > } catch (Exception e) { e.printStackTrace(); } > } > public PropertyDescriptor[] getPropertyDescriptors() { return properties; } > public int getDefaultPropertyIndex() { return -1; } > public MethodDescriptor[] getMethodDescriptors() { return methods; } > public EventSetDescriptor[] getEventSetDescriptors() { return eventSet; } > public int getDefaultEventIndex() { return -1; } > public BeanDescriptor getBeanDescriptor() { return new BeanDescriptor(beanClass); } > public BeanInfo[] getAdditionalBeanInfo() { return null; } > public java.awt.Image getIcon(int iconKind) { return null; } >} > > > > > >