A VirtualObject is an object that doesn't formally exist within the framework of the programming language. It exists as word, concept and object in the framework of the LopLanguage. -- HelmutLeitner These examples are trivial. They are not meant to teach something new. They are necessary to explain the term VirtualObject as it is used in LanguageOrientedProgramming. ---- The following function calls are without an explicit object reference. The words "World" and "System" represent the VirtualObject''''''s (no need to explain them). wtime=W''''''orldRetTime() wtime=W''''''orld.retTime() stime=S''''''ystemRetTime() stime=S''''''ystem.retTime() Usually programmers would use terms like "namespace" or "toolkit class" to speak about such a situation. But note that in LanguageOrientedProgramming the words "World" and "System" are not arbitrary, they are meant to model real objects. They have to be justified, defined and documented before you are allowed to use them. ---- The following function calls use more than one parameter as an object reference. Rewritten (and extended) from the standard C library: M''''''emClear(p,size) M''''''emSetChr(p,size,char) M''''''emCmpStr(p,size,s) S''''''trCpyMem(s,p,size) F''''''ileCpyMem(filename,p,size) M''''''emFindStr(p,size,s) M''''''emFindChr(p,size,char) The object Mem is represented by a Pointer and Size parameter (and means an arbitrary range of RAM memory). It stands for an object abstraction that does only exist in the mind of the programmer. ''Why not actually represent Mem as a object (strictly an ADT) that holds the pointer and size as member variables, and controls access to those variables with methods or access functions?'' * Answer one: usually this abstraction is only valid for a very short time, say one or two function calls. So the overhead of an object doesn't make sense. * Answer two: very often it *is* made an object, but then it aquires a meaning, additional functionality and a name. So it is not the virtual object Mem anymore. Just an example from a "higher level": I''''''mageRectClear(image,pRect); I''''''mage.R''''''ectClear(image,pRect); I''''''mageRectWriteFile(image,pRect,"test.jpg"); I''''''mage.R''''''ectWriteFile(image,pRect,"test.jpg"); I''''''mageRectSetColor(image,pRect); I''''''mageRectMoveKxyAbs(image,pRect,x,y); I''''''mageRectMoveKxyRel(image,pRect,delta_x,delta_y); In this case I''''''mageRect is an abstraction that may be used in a lot of functions but is not (and perhaps will never be) an object of its own. LanguageOrientedProgramming requires that such potential for introducing order and symmetry in an API is used. ---- See also: LanguageOrientedProgramming, ThelopLanguage ---- CategoryThelop