Hi,
I was experimenting today with a class that I am writing. The class requires access to a TYPE structure via an INSTANCE variable. No big deal, that is pretty straight forward to do.
The "problem" is that the TYPE definition can not be located within the CLASS so therefore it will be exposed to the rest of the program. No big deal if the Class is located in a DLL, but my Class is in a simple #INCLUDE that I would like to put into any new source code that I write or share with others for them to include in their code bases.
My concern involves the TYPE/END TYPE now having the potential to cause a naming conflict with an existing TYPE in someones code. In the grand scheme of things it is no big deal other than dealing with the renaming thing, and I guess the odds are pretty low if give the TYPE a unique name (maybe use a GUID?) but the potential exists nonetheless.
I guess I just wanted to throw it out there that maybe TYPEs could be defined within CLASSes so that their definition is private to the CLASS. This would be consistent with the idea of encapsulation? Maybe I'm making too much of this but its Friday afternoon and I have nothing else to talk about.
I was experimenting today with a class that I am writing. The class requires access to a TYPE structure via an INSTANCE variable. No big deal, that is pretty straight forward to do.
The "problem" is that the TYPE definition can not be located within the CLASS so therefore it will be exposed to the rest of the program. No big deal if the Class is located in a DLL, but my Class is in a simple #INCLUDE that I would like to put into any new source code that I write or share with others for them to include in their code bases.
My concern involves the TYPE/END TYPE now having the potential to cause a naming conflict with an existing TYPE in someones code. In the grand scheme of things it is no big deal other than dealing with the renaming thing, and I guess the odds are pretty low if give the TYPE a unique name (maybe use a GUID?) but the potential exists nonetheless.
I guess I just wanted to throw it out there that maybe TYPEs could be defined within CLASSes so that their definition is private to the CLASS. This would be consistent with the idea of encapsulation? Maybe I'm making too much of this but its Friday afternoon and I have nothing else to talk about.

Comment