Click to See Complete Forum and Search --> : how to encapsulate an entire system and then fit future change? (details inside)


LifeIsSuffering
March 24th, 2008, 09:14 AM
I have a GUI system and I'm gotta build a new system upon it. My requirement is,

1. The new system will have a set of new interfaces, that means the GUI system should be invisible to users.
2. The new system shouldn't simply wrap all interfaces, since some new non-UI features would get added.
3. The underlying GUI system may entirely get substituted someday.

I'm trying to use the bridge pattern to design the system. I'm planning to add a middle, totally abstract, system, which defines all required interfaces, and definitely it should reflect all original inheritance relationship between widgets. Sth like,
NewSystem -> AbstractSystem -> RealImplementedSystem

However, the problem is that, you know, the GUI system has lots of different interfaces on different widgets, so that the abstract system is hard to build. It should be only composed of pure abstract classes in one inherited tree, which reflects the relationship between widgets. Another problem is that even if I get this middle abstract system, it would be a tough work to implement it. I gotta repeatedly code so much similar interfaces which may just redirect the operation to underlying real system.

Any other way for the design? Thx in advance.

JamesSchumacher
March 24th, 2008, 10:34 AM
Unfortunately, the best way to accomplish this is to write an entire graphics package that handles all the GDI (drawing routines) operations itself. That is to create a graphics package that can handle all drawing in user mode.

I am in the process of working on this myself, although it's not only the GDI/GUI/Windowing part. The project is called TradeWinds, it's not OpenSource. It will not help you implement, except maybe in a design pattern for the framework. I have not gotten very far with the Graphics part, however... the parts I do have done you can check out the Graphics namespace.

The link is in my signature.