Exforsys

Free Training

Design question for UI library

This is a discussion on Design question for UI library within the Software Patterns forums, part of the Testing category; Hi everyone, I am writing a small user interface library in C++ (I know it has been done to death, ...

Go Back   Exforsys > Testing > Software Patterns

Exforsys.com

  #1 (permalink)  
Old 12-09-2005, 05:53 PM
xargon
Guest
 
Posts: n/a
Design question for UI library

Hi everyone,

I am writing a small user interface library in C++ (I know it has been
done to death, but it is good for learning ).

Anyways, I need some help/advice with the deisgn of the software
architecture. The problem I am facing is that a control can have so
many states... For example, a button could be have various shapes
(rounded, square, some other custom geometry). Also, it could be
bitmapped, textured, text only, text with bitmap etc. So, you get the
picture. Having a specialized Button class for each of these would be
very difficult to maintain.

So, my question to you gurus is how would you organize a widget library
like that. What design patterns would you recommend that I look into?
Any advice would be appreciated.

Thanks and cheers!

xargy

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-11-2005, 01:18 PM
iscy
Guest
 
Posts: n/a
Re: Design question for UI library

First, you should probably get the book called GoF95. It'll be very
handful for this task and for any other that you'll do in future. For
your information, the patterns that you'll need to use for the button
example will first be the visitor and the state. In that case, the
visitor will be able to change the state of the button using
strategies. Since your GUI classes will probably be built using a
composite (in order to be able to use any widget as a widget),
everything will be produced from a factory. Then in general, those are
patterns that will show a very simple architecture. Remember that you
can't just use one design pattern for something. DP are beautiful
because they are like lego. Assemble them as you wish and you are going
to get something good.

Anyway, GoF95 will be a good start in order to get your hands on a few
and really useful design patterns. Something that you'll probably
appreciate from that book, are the examples. They are using 'GUI' code
to demonstrate patterns.

GoF95 stands for Gang of Four (produced in 1995)
The real name of the book is: "Design Patterns" done by 4 guys...

I hope that's going to help you
iscy

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-07-2006, 08:17 AM
EventHelix.com
Guest
 
Posts: n/a
Re: Design question for UI library

Look for the Movel-View-Controller design pattern. This pattern has
been used in several GUI frameworks.

--
EventStudio System Designer 2.5 - http://www.EventHelix.com/EventStudio
Sequence Diagram Based Systems Engineering and Object Modeling Tool

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 02:05 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
Copyright 2004 - 2009 Exforsys Inc. All rights reserved.