Three classes within the DLL need to know the status of a specific table
within a database. So I've created a class that, when instantiated,
checks the status of that table, comparing it to the same data stored
locally in an XML table. The objects instantiated from the three
classes mentioned above can then make decisions based upon the
differences between the data on the server and the data within the XML
table. Naturally, I would like to consume the necessary resources and
network bandwidth as infrequently as possible.
The obvious thing to do is instantiate the object that makes this
comparison when the application first opens. But, it occurred to me
that there might be an inialization event within a DLL that would ensure
that this took place even if someone else used the same DLL for another
application in the future.
Another possibility would be to cause each instantiation of each of the
three classes that need this information to check for it themselves, but
then again, I would like to conserve resources and bandwidth.
Thanks for your help.
Peter Bromberg [C# MVP] wrote:
I think you need to clarify what you mean by "Object" when in the next
sentence you say "the classes". In .NET, an "object" is an instance of a
class.
If that's what you mean, it can be done in the contructor.
Peter