...
initialize
value := 0.
TV open: self.
...
add: anInt
value := value + anInt.
self changed: #value.
instanceVariableNames: ''
TV methodsFor: 'updating'
update: aValue
Transcript show: 'ok'; cr .
TV class
instanceVariableNames: ''
TV class methodsFor: 'instance creation'
open: aCtr
self new model: aCtr
name -- denotes an object, a function, set of functions, enumerator, type, class member, template, a value or a label
object -- region of storage
public:
ctr(int i = 0, char* x = "ctr") {
n = i; strcpy(s,x);
}
ctr& operator++(int) { n++; return *this; }
int operator()() { return n; }
operator int() { return n; }
operator char*() { return s; }
private:
int n; char s[64];
};
Usage
See: www.javasoft.com
and java.sun.com/docs/books/tutorial
Hello World - class
Query
agency() :- accept( any ), agency().
book(X,Y) :-
reachable(X),
price(X,Y).
price(amsterdam,5).
...
}
The Unified Modeling Language (UML) resulted from a joint effort of leading experts in object-oriented analysis and design, Grady Booch, Jim Rumbaugh and Ivar Jacobson, also known as the three amigos, all currently employees of Rational.
See www.rational.com/uml
and UML Distilled,
The UML toolbox is very rich. It allows you to model every conceivable aspect of the system. Nevertheless, to my mind, graphical models are not always appropriate. But, on the other hand, most people like them and they often make a good impression, suggesting clarity ...
See www.infosys.tuwien.ac.at/Research/Corba/OMG
interface world {
void hello();
void ask(in string x);
string tell();
oneway void halt();
};
};
InterfaceDef get_interface();
Object duplicate();
...
}
universe.idl
interface world {
void hello();
void ask(in string x);
string tell();
oneway void halt();
};
};
main :-
broker(server(universe:world)).