Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Abstract class needs access to table
Message
From
25/08/2008 11:18:20
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01341481
Message ID:
01341528
Views:
9
>>>I have a class built that communicates with a hardware device. This device may be connect via serial, ethernet or ftp. The properties of the class set all the necessary parameters of the device... tcpip/serial/ftp, address, port, bps, parity, etc. The class is instantiated, properties are set (based on settings stored in a device table) and the communication takes place. This works great. But occasionally after the class is instantiated and the properties are set, the device needs to be changed to a different one. This requires access to the device table. I don't like the idea of tying the class to a table to query it. I have don't have any ideas on how to keep this class abstract yet still query the data in my device table. Any ideas?
>>
>>Make the name and path to the table a property of the class, so you can change it at runtime?
>>
>>Tamar
>
>Yes but then I have to hard code field names and queries into the class. That doesn't seem like a good idea does it?

That table is your metadata. It is code, just packaged as a table. It's under your control (or if it isn't, it should be).

And you can package the queries as scripts in memo fields of that table, so whatever is specific to one device should be in that device's record.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform