By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,797 Members | 1,794 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,797 IT Pros & Developers. It's quick & easy.

architecture to adopt

P: n/a

I would like to learn a good object approach and to do so I have started
to design an application used to manage smart cards.
It's developped with a multi-plateform gui toolkit (wxWidgets)
You can see a screenshot here :

As you can see a SmartCardProject is composed of

one or many Readers,
one or many Card and each card is composed of CardCmds
one or many script files
So I did this :

class SCardReader
SCardReader(wxString strRealName,
wxString strUserName)

wxString m_strRealName;
wxString m_strUserName;
WX_DEFINE_ARRAY(SCardReader*, SCardReaderArray);


class SCardCmd
SCardCmd(const wxString& strCmdName);

wxString m_strCLA;
wxString m_strINS;
wxString m_strP1;
wxString m_strP2;
wxString m_strLc;
wxString m_strData;
wxString m_strLe;
wxString m_strResponse;
wxString m_strSW;
WX_DECLARE_HASH_MAP(wxString, SCardCmd*,

class SCardDesc

wxString strUserCardName;
SCardCmdHMap m_scCmds;
WX_DECLARE_HASH_MAP(wxString, SCardDesc*,

class ProjDockBar;

class SCardPrj

SCardPrj() {}
SCardPrj(ProjDockBar* pProjDockBar);
virtual ~SCardPrj();

void AddReader();
void AddCardDesc();
void AddCardCmd();
void AddCardCmd(const wxString& strCardName);
bool GetCardCmd(wxString strCardCmd, SCardCmd& refCardCmd);

void UpdateGUI();

SCardReaderArray m_scReaders;
SCardDescHMap m_scDesc;
PrjTree* m_pPrjTree;

My problem is about how can I associate my project and the GuiPart.
For now when someone right-click on a CardCommand item I offer the
choice to add a CardCommand, so I get a pointer on a Scardprj and I call
AddCardCmd and this method update the Gui by calling a method
belonging to my tree.

The flow is :

Gui(Project Tree) is requested to make a change --->SCardPrj is notified
and do the action ---> Update Gui

Is it the right way to do, actually since my Project Structure is almost
the same as its Gui counterpart(Tree), is there a mean of coupling these
two things ?
Dec 22 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.