mk-soft wrote:
Sorry, i don´t understand complete what you mean. (my english)
Same for my english... if germans write english...
But i think it is also interesting for the people here around. So i try to explain this a little bit more (next try..)
Say i have a Baseclass like :
Code:
Class cBase
cBase()
serialize(*xml_node)
deserialize(*xml_node)
id.l
name.s
type.l
EndClass
Procedure cBase.cBase()
EndProcedure
Procedure cBase.serialize(*xml_node)
;
;.. write id, name and type as tags to the xml.
;
EndProcedure
Procedure cBase.deserialize(*xml_node)
;
;.. read id, name and type as tags from the xml.
;
EndProcedure
Now i want hav a class the derives from the base class :
Code:
Class cAction
cAction()
execute()
serialize(*xml_node)
deserialize(*xml_node)
;now only the vars for this Action
;we iherited the id,name and type from the base-class
actionName.s
actionPath.s
actionTimeout.l
EndClass
Procedure cAction.cAction()
;; should able to call the parent Constructor
;; for basic initis.
;;but without knowing the name of the Base-Class
EndProcedure
Procedure cAction.execute()
;;Do the Action
EndProcedure
Procedure cAction.serialize(*xml_node)
;;call parent first
*parent\serialize(*xml_node)
;;
;; now write my own vars to the xml
EndProcedure
Procedure cAction.deserialize(*xml_node)
;;call parent first
*parent\deserialize(*xml_node)
;;
;; now read my own vars from the xml
EndProcedure
This ends up with the 'feature' that i can have a Array or LinkedList filled with different action-objects, but i have only to call 'execute() to start the action, and using a serialize() to write them (completly) or a deserialize() to read them back.
I have not to know the parent of a class. That should be capsuled via OO.
I hope that clears what i want . So i was a C++/Java man, and i wrote the Pattern (Command-Pattern) often enough. And i really like it much.
Would be nice - and important - to get that work.
BTW: I cannot understand Fred with his ignorance against OOP. He gives us the Interface as a basic step to OOP but denies support via Compiler.
So he has not to reinvent the complete Purebasic only to add a feature. that the people can use - if the want. Maybe as for some extra cash.
(i would pay for that !)
But its a fact that OO is a good solution for greater projects.
Mike
EndClass