The module is not OOP.
A module can be compared to a static class, but it is not a fully functional analogue.
Version 6.10 update?
-
- Addict
- Posts: 1516
- Joined: Wed Nov 12, 2008 5:01 pm
- Location: Russia
- the.weavster
- Addict
- Posts: 1576
- Joined: Thu Jul 03, 2003 6:53 pm
- Location: England
Re: Version 6.10 update?
Correct. PB nicely separates data from behaviour.
But it's not like the two paradigms are so far from each other that you have to totally change your thinking.
Re: Version 6.10 update?
Even though I sometimes use OOP, I don't really want it as a base in PB. But sometimes it would be nice to have some helper functions to fill in the virtual methods to support external OOP.
OOP is a memory-hungry and performance-hungry method to force users to buy faster and bigger computers.
OOP is a memory-hungry and performance-hungry method to force users to buy faster and bigger computers.

My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
-
- Addict
- Posts: 1516
- Joined: Wed Nov 12, 2008 5:01 pm
- Location: Russia
Re: Version 6.10 update?
The simplest implementation of OOP - procedures in structures and the presence of a constructor and destructor, does not require a large amount of memory and a powerful processor.
In some cases OOP allows a program to be written more efficiently.
In some cases OOP allows a program to be written more efficiently.
Re: Version 6.10 update?
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
-
- Addict
- Posts: 1516
- Joined: Wed Nov 12, 2008 5:01 pm
- Location: Russia
Re: Version 6.10 update?
Does this module implement an automatically called constructor and destructor?
For example, when we create a local instance of a structures, string, array, or list in a procedure, we do not need to worry about initializing and deinitializing them.
In the same way, a constructor and destructor should be automatically called for an object.
I suggested this for structures. https://www.purebasic.fr/english/viewtopic.php?t=71572
Procedures in structures https://www.purebasic.fr/english/viewtopic.php?t=45156
For example, when we create a local instance of a structures, string, array, or list in a procedure, we do not need to worry about initializing and deinitializing them.
In the same way, a constructor and destructor should be automatically called for an object.
I suggested this for structures. https://www.purebasic.fr/english/viewtopic.php?t=71572
Procedures in structures https://www.purebasic.fr/english/viewtopic.php?t=45156
Re: Version 6.10 update?
Yes, you only have to assign a Procdure as Constructor (AsInitalizeObject) and a Procedure as Destructor (AsDisposeObject).User_Russian wrote: Fri Dec 01, 2023 8:51 pm Does this module implement an automatically called constructor and destructor?
For example, when we create a local instance of a structures, string, array, or list in a procedure, we do not need to worry about initializing and deinitializing them.
In the same way, a constructor and destructor should be automatically called for an object.
I suggested this for structures. https://www.purebasic.fr/english/viewtopic.php?t=71572
Procedures in structures https://www.purebasic.fr/english/viewtopic.php?t=45156
These are also called automatically in the correct order in the case of inheritance or multiple inheritance.
Desciption of Module BassClass
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive