having first class interface or tools

Klaus D. Witzel klaus.witzel at cobss.com
Tue Jul 11 14:53:28 UTC 2006


Hi Stef,

on Tue, 11 Jul 2006 14:27:24 +0200, you wrote:

> I know I was thinking something in the vein of dynamic interfaces of  
> Benny Sadeh (JOT) to check changes /dynamic changes.

Yes, JOT is a good approach but, because its J-mimicry suffers from the  
possibility to use reflection for offering (and for negotiating) an  
interface (sorry Mr. co-author ;-) What I have in mind is a single method  
on the class side which answers the *offered* interface in form of an  
intelligent object which is modeled analogue to Teachable, see draft at  
the bottom.

> Hence I was interested in the application of Goya.

Here we go: tell me two system categories or two non-overlapping subsets  
of classes and, if the interface is covered somehow by TestCase(s), using  
Goya I can tell you who does what (re. my informal pres. in Bern).

/Klaus

=========draft==================

!MyObject class methodsFor: 'interface-negotiation'!
interface
	| negotiable |
	" offer getter+setter for value named #attribute "
	negotiable := NegotiableInterface on: self " <= self is MyObject, a  
behavior ".
	negotiable offer: #attribute initialValue: nil.
	negotiable offer: #attribute: subDomain: Collection.
	^ negotiable!!

...use...

	interfaceOnMyObject := MyObject interface " <= this is analogue to #new  
but returns an interface instead of an instance ".
	self assert: (interfaceOnMyObject offers: #attribute forMeAs: #getter)  
description: 'bad interface'
	self assert: (interfaceOnMyObject offers: #attribute: forMeAs: #setter:)  
description: 'not allowed to change this value'
	" imagine the use of blocks for queries "

...etc




More information about the Squeak-dev mailing list