Hallo NG !
I Have a little question about inheritance of a singleton class.
In my application i have a Database-Connection Lib, in which I would šlike
to connect different databases of the same project (thats why it is in a
lib).
For the database A I created a singleton class AProxy and for the database B
the same as BProxy. Initializing and connetcing to the Database is the same
in both classes (except of the database-path, which is a parameter), just
the Functions are different, because the tables are different.
Now I thought about creating a general DBConnectifity-class (or interface)
to generalize the Initializing and db-connection stuff in this class and
define the specific function in the suc-classes.
I'm new in using patterns and .NET-Programming (OO-Programming) and I'm not
sure, if that work proper. In a little test application I allways get an
compile error, because it is not possible to convert a class2 (subclass of
class1) in a class1 (general singleton class) object by calling
getInstance().
It is possible to inheritance of a singleton class ?
What did I wrong ?
Thanks
Regards
Marcel Hug