modika11
Programmer
- Jan 31, 2008
- 20
Hi All,
i have created an architecture. I have a base company class, of which client and vendor inherit. each of the client and vendor classes have their own set of configurations that are specific to them. So in my base company class i create a shared property which is an an interface (iCompanySettings) of which clientSettings and vendorSettings implement. This all works (kinda) but the problem i have is i have to instantiate a instance or clientSettings or vendorSettings in the constructor of the client and vendor classes. This is not really a problem for my normal methods, but i am trying to define some shared (static) methods which break as no instance has been created before they are used. is there a way in the derived classes that i can set the settings variable from the base class outside the constructor whithout it erroring or is their a more elegant solutin to the one ihave implemented?
Any thoughts would be great.
Thanks,
Rob
i have created an architecture. I have a base company class, of which client and vendor inherit. each of the client and vendor classes have their own set of configurations that are specific to them. So in my base company class i create a shared property which is an an interface (iCompanySettings) of which clientSettings and vendorSettings implement. This all works (kinda) but the problem i have is i have to instantiate a instance or clientSettings or vendorSettings in the constructor of the client and vendor classes. This is not really a problem for my normal methods, but i am trying to define some shared (static) methods which break as no instance has been created before they are used. is there a way in the derived classes that i can set the settings variable from the base class outside the constructor whithout it erroring or is their a more elegant solutin to the one ihave implemented?
Any thoughts would be great.
Thanks,
Rob