• Content count

  • Joined

  • Last visited

Community Reputation

149 Neutral

About GoldenArm

  • Rank
  1. You guys are genius !!! Was struggling with getting my thread encapsulation done properly, that functor method in a struct of a base class did the job !!!   thanks
  2. While I am no way qualified to answer your question, the problem origin (in my opinion) is almost the same of the Adapter design pattern. Id say at some point you have to know the configuration of your client, is he running linux/windows and can he provide opengl/directx9,10 support. From there you can instanciate the good Renderer via a class that : OpenGLRendererAdapter DirectX9RendererAdapter DirectX10RendererAdapter If you use polymorphism all of yours adapter must use the renderer interface (as pointed out by the guy 2 posts up) thus kind-of limiting you. This pattern is best understood with an SQL connecter class example. If you have to provide the following functions : connectDB(name,ip), disconnect(), select(query), etc... You implement the MySQLAdapter, OracleSQLAdapter, MSSQLAdapter with the interface and you can pick up at run-time which class you want to instanciate. In java : InterfaceDBConnecter myDBConnecter = new MySQLAdapter();