Skip to content

Object composition

Richard Baltrusch edited this page Mar 9, 2021 · 2 revisions

Object composition

Object composition, meaning objects containing other objects, is achieved in objectbatch using the sub keyword. For example, if we have a class A defining attributes a and b, where b is another class B (which itself defines attributes c and d), the attribute structures would look as below:

A.a
A.b.c
A.b.d

The example above may be implemented by defining the following constructor for class A:

:public-construct --> 1:objectname
	call super %*
	call sub B b construct
	set %self%.a=0
exit /b

More information

More information can be found in the home page, the quick start page and the examples.

Clone this wiki locally