LarsG, Amiga5k,
This is exacly what I'd like to work towards.
My plan is to first create it through code generation. Something like
Code: Select all
Class MyObject
Private
Procedure This
blah
EndProcedure
EndPrivate
Public
Procedure That
blah
EndProcedure
EndPublic
EndClass
This would then be passed through a preprocessor that would convert it into the corresponding PB code.
My biggest problem is the fact that it will have to generate functions, giving them names that will be accessible to other programs. For 'proper' encapsulation the internal procedures should only be accessible through the interface.
I see a couple of solutions to this
1) If PB allowed anonymous functions then I could use these. I ased for them but Fred didn't take the bait
2) Create DLLs. This would be nice a flexible, but you lose static linking. Using VB at work has given me a hatred of DLL hell.
3) Create Userlibraries, similar to the way Tailbite does it. I think this would be a neat solution, but I don't know how to do it. When the time comes I hope El_Choni is willing to show me how.
My implementation of objects would be a little different. I'm hoping to implement them as Relational rather then as a network linked by pointers. If my planning is correct this will allow for perfect resource management with all objects destroyed automatically without the overhead of a garbage collector. It is all part of my planned Master's dissertation.