Exforsys

Online Training

problel of design

This is a discussion on problel of design within the Software Patterns forums, part of the Testing category; I have a design problem: I have these classes: app : application res: resource window: gui what I want to make ...


Go Back   Exforsys > Testing > Software Patterns

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-01-2004, 07:52 AM
yag
Guest
 
Posts: n/a
problel of design

I have a design problem:

I have these classes:
app : application
res: resource
window: gui

what I want to make is:
windows: call a app->getResBmp(FILENAME) ;
windows: use string to loadfile

but:
I would want to find the way to be able to have like return value these:
String, Binari, ecc.

The solution simpler (but wrong) is a method for every resource and every returned type therefore

es:
--------------

class app{
res obj:res;
}

class res{
//two for type of resource
string getbmpString();
BYTE getbmpBinary();

string getSoundString();
BYTE getSoundBinary();

ecc.
}

res delegation to:
class bmpResource , class soundResource that they are derived they give class <<interface>>typeRisorce

window{
use :

//this
filename = res->getbmpString();
funcgui->loadfilename(filename) ;
//or
resource = res->getSoundString();
funcgui->loadfileresource(filename) ;
}

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-14-2004, 04:49 AM
Ken Loh
Guest
 
Posts: n/a
Re: problel of design

Have you consider using template ?

"yag" <yagyog@tiscali.it> wrote in message news:<qsphd.240251$35.11321442@news4.tin.it>...
> I have a design problem:
>
> I have these classes:
> app : application
> res: resource
> window: gui
>
> what I want to make is:
> windows: call a app->getResBmp(FILENAME) ;
> windows: use string to loadfile
>
> but:
> I would want to find the way to be able to have like return value these:
> String, Binari, ecc.
>
> The solution simpler (but wrong) is a method for every resource and
> every returned type therefore
>
> es:
> --------------
>
> class app{
> res obj:res;
> }
>
> class res{
> //two for type of resource
> string getbmpString();
> BYTE getbmpBinary();
>
> string getSoundString();
> BYTE getSoundBinary();
>
> ecc.
> }
>
> res delegation to:
> class bmpResource , class soundResource that they are derived they give
> class <<interface>>typeRisorce
>
> window{
> use :
>
> //this
> filename = res->getbmpString();
> funcgui->loadfilename(filename) ;
> //or
> resource = res->getSoundString();
> funcgui->loadfileresource(filename) ;
> }
>
> --

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

Thread Tools

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 03:28 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.