Archived

This topic is now archived and is closed to further replies.

bilsa

bad practice // hack ?

Recommended Posts

Ok, would you guys consider this to be bad practis or hacking?
#define LOG_INTERFACE_VER(interface_version) ILog##_V_##interface_version 

class LOG_INTERFACE_VER(1_1) : public IBase {
	LOG_INTERFACE_VER(1_1)();
	~LOG_INTERFACE_VER(1_1)();
	
	virtual Init();
	virtual Release();
};
  
I was thinking of having some kind of system similar to COM. Every Interface like this one, will register itself at a SystemManager that keeps track of all possible Interfaces. Now, when I want to update a specific Interface I just derive it from the old one and add new functions to that interface and register it at the SystemManager. This new one will contain a pointer to the previous version of the interface. The thing is that I will have some kind of version variable//definition in the "1_1" above. And the same thing will be for different Implementations of the interfaces. So when I want to use an interface from the SystemManager I just query for it... Ah well, just two seconds ago I had some point in this... just can't see it now lol... think I'm kinda tired, heh Anyway... would that kind of code be bad practice, if you never would actually type decrations like this in you application anyway: ILogSomeVersion *newLog = new ILogSomeVersion(); The only way would be to use the SystemManager to get the wanted interface//implementation thx ... and good night, sigh ... [edited by - bilsa on January 16, 2004 7:16:58 PM]

Share this post


Link to post
Share on other sites