F
Frank Osterberg
I want to make some shared methds overridable but dotNet will not allow me
to do so.
Why not? What possible reason could there be to not allow that?
Yes, i know i can make a sigelton and wrap shared methods, but that is just
moronic considering that a the shared members are just references to special
forms of a 'singelton' instance, or am i wrong here?
Is it just one of those 'it not BEST programming practices = stick up the
a**' reasons, like ALWAYS having to EXPLICITLY type cast EVERYTHING in some
stupid languages like java?
You know, the sort of reasons that just make you hate a programming
language?
Or will it work with .Net 2008?
Or maybe there IS a better way to do what i want to do:
Have a class with a name like SystemDB with shared members.
It will coordinate all calls from different modules/threads with one (or
two) database connections so that i can do something like:
For Each oRecord As DataRecord in SystemDB.Query("select * from dual;")
' etc
Next
or
SystemDB.InsertAsync("insert into....")
without having to care/worry about which thread i am using or what my local
instance reference was called.
I am already using it throughout my code, but now i would like to make it
extensible, so that i can have one base class called GlobalDB that must be
inherited but wher different protected methods can be overridden.
So considering that, is there a better way? I definitely do not want to have
any additional prefixes like:
otherClass.SystemDB.Something
since that makes the whole thing ugly again..
Thanks for any help/comment/info/suggestion,
Regards,
Frank
to do so.
Why not? What possible reason could there be to not allow that?
Yes, i know i can make a sigelton and wrap shared methods, but that is just
moronic considering that a the shared members are just references to special
forms of a 'singelton' instance, or am i wrong here?
Is it just one of those 'it not BEST programming practices = stick up the
a**' reasons, like ALWAYS having to EXPLICITLY type cast EVERYTHING in some
stupid languages like java?
You know, the sort of reasons that just make you hate a programming
language?
Or will it work with .Net 2008?
Or maybe there IS a better way to do what i want to do:
Have a class with a name like SystemDB with shared members.
It will coordinate all calls from different modules/threads with one (or
two) database connections so that i can do something like:
For Each oRecord As DataRecord in SystemDB.Query("select * from dual;")
' etc
Next
or
SystemDB.InsertAsync("insert into....")
without having to care/worry about which thread i am using or what my local
instance reference was called.
I am already using it throughout my code, but now i would like to make it
extensible, so that i can have one base class called GlobalDB that must be
inherited but wher different protected methods can be overridden.
So considering that, is there a better way? I definitely do not want to have
any additional prefixes like:
otherClass.SystemDB.Something
since that makes the whole thing ugly again..
Thanks for any help/comment/info/suggestion,
Regards,
Frank