>>>I have a moment of brain shortage, right now I can't see the forest for all the trees. Is it possible from within an object to know what is the name it's instantiated as? Given this code
>>>
>>>
>>>loCountries = NewObject('SqlTable','SQL.vcx')
>>>
>>>In this case I want the class SqlTable to understand that it's instantiated as loCountries. I am building a rather complicated generic class to work with SQL tables. My idea is that if I call the object for instance loCountries, my class can be smart enough to know that I want it to connect to the SQL table called Countries.
>>
>>It seems wrong way to go about it. A Class/Instance shouldn't know or care how it's instantiated.
>
>Maybe the real brain shortage was the whole silly idea. :-)
Some part of me wanted to argue similar to Sergey, but often naming the references for the underlying data makes sense - if you encounter
Use Person Alias Ticket
Use Ticket Alias Person
this would create some disturbance. Perhaps Having in each class the data access path and "metainformation" predefined as property and then creating those classes as property names reflecting that "inner structure" metainformation would be analogous to a simple
Use TableName
creating a fitting alias name
my 0.02€
thomas