Quote:Original post by matibee
The organisation of classes such as class BaseWindow; class Win32Window or class XWindow will lead to you having several versions of your application code.
The problem is win32 & X window system work completely different, there isn't much you can share in implemenation apart from say a string for the window title.
Quote:Original post by matibee
Look at the main() in snk_kid's example - it's platform specific. I know it's just an example, but I saw it as a trap to be avoided :)
Are sure you even understand the code, its not platform specific, sure currently the window imps doesn't share any implementation buts its not hard to factor out commonality into a base type or begin with a base type and then specialize to sub-types.
Even if you go the sub-type polymorphic route clients must still specify which platform there going to be on unless you detect which platform clients are on.
Quote:Original post by matibee
I'm really aiming for the application code to be as portable as possible and I don't see any reason why it can't be 100% so, given the right interfaces.
To achieve something like this you need to
completely abstract each feature you support in each API your going support like the example of the icons.
EDIT: i would agree with DigitalDelusion some kind of bridge pattern would probably be the best way to go, you can still share implementation in a commmon base you don't have a pointer to the base type.
[Edited by - snk_kid on September 18, 2004 4:13:12 AM]