>It works this way: You define a property oBiz in your container and set it's value to "<-expression", the method above will evaluate the expression. So a simple expression could be "<-Createobject('bizclass')".
Yes, that's what I'm doing. Just calling the factory instead.
>The idea you already used with a factory has the problem of the datasession, but that could also be solved by passing in THISFORM or THIS to the factory as an toParent parameter and the factory could use toParent.Addobject() to instanciate some class and voila, it's part of the form's session, not of the session the factory is in.
This and Thisform don't exist yet. It simply doesn't evaluate the expression when I try to pass them as parameters. So instead of that, I have a general function CallFactory() which instantiates the factory on the fly, creates the object (and since it's in a .prg, executes in current DS, so the factory and anything it creates are in that same DS), kills the factory and returns the object. Since the factory is, almost by definition, very lightweight, this costs almost nothing in terms of performance.