Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3217750
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:26:51+00:00 2026-05-17T15:26:51+00:00

guys, I am programming a GUI for an application, a cd container to insert

  • 0

guys, I am programming a GUI for an application, a cd container to insert cd, and currently I am not very clear and I think I need some help to clarify my understanding about object oriented design.

so, first, I use observer pattern to build abstract Model and View classes and also the concrete models(cd container) and concrete views(cd container view). Then I start to use the wxwidget framework to design and graphical appearance or layout (CDContainerWidget, from wxPanel) for the cd container and other gui controls MainFrame(from wxFrame), etc..

so now I have three classes: CDContainerModel (cd container), CDContainerView (the class for observer pattern), and CDContainerWidget (the gui controls).
then I become not that clear about what I should do with the CDContainerView and CDContainerWidget?

I think CDContainerWidget and CDContainerView both need CDContainerModel. I think about four approaches, but do not know which one is approriate:

1). associate CDContainerWidget into CDContainerView as a member variable, then put the CDContainerView into the Main Frame as a member variable.

class CDContainerView:
  def __init__:
     self.gui=CDContainerWidget

class MainFrame:
  def __init__:
     CDContainerView

2). CDContainerView subclass CDContainerWidget:

class CDContainerView(CDContainerWidget):

class MainFrame:

   def __init__:

     CDContainerView

3). CDContainerWidget subclass CDContainerView:

class CDContainerWidget(CDContainerView):

class MainFrame:
  def __init__:
     CDContainerWidget

4). instead of using CDContainerWidget and CDContainerView, use only a single class CDContainerBig which subclass the abstract class View and wxPanel

class CDContainerBig(View, wxPanel)

My question is what is the right solution? I have read the wiki page of MVC pattern, but I do not really understand its descrption and do not know how and also wonder if it is approriate to apply it to my problem.

well, I put some additional comments. originally, when i start to design to program, I did not think much and just choose, 2) approach. but now, I think 3) is good. since it is reasonable to put widget in widget(CDContainerWidget into MainFrame). but I am not really sure. Also it seems with observer pattern, the three classes are twisted and awkard. And sometimes, it appears to me that these 4 maybe are the same, just who includes who, or who sends messages to who. well, I think I really need clarification on this point.

Also, I am in favour of 3) because of a practical point.The CDContainerWidget actually contains several subwidget components (button, input box, etc.) and if we change something like set new values via a subcomponent widget, then for 1), we need CDContainerWidget to be aware of CDContainerView, to let CDContainerView to notify other views. for 2) even worse, CDContainerWidget has to be aware of its childen CDContainerView. for 3) CDContainerWidget itself is CDContainerView, so quite reasonable. for 4) well, easy but no logic separation. this is my own thought, do not know if it is correct.

Thanks!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:26:52+00:00Added an answer on May 17, 2026 at 3:26 pm

    What might make this a bit easier for you to shed the coupling between classes would be implementing a signal slot pattern with something like Spiff Signal, or one of the other signal/slot modules available.

    By decoupling the communication logic you can free yourself entirely of the need for modules to talk directly but rather use message passing with callbacks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

guys! I am very interested in game programming.I have spent some time learning C++
I am very new to LaunchD programming. I need to develop an application which
This is my first step to programming.guys your help hands required.I watched youtube video
Hi, guys! Currently I'm reading a book Programming in Objective-C by Stephen Kochan. Actually
Hey guys - I know this is not a strictly programming question but I'm
Hey guys, I'm very excited about how experienced I am in programming. The first,
I know it's not a programming question per-se, but come on guys - give
Guys from book C++ GUI programming with qt I'm reading a chapter on how
I am a beginner in .NET programming, so help me guys. My question: When
Heyy guys, i have one short question: What programming language/framework do you think is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.