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

  • SEARCH
  • Home
  • 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 907781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:36:25+00:00 2026-05-15T16:36:25+00:00

I’m new to designing OO systems. I have a simple Flash Cards app where

  • 0

I’m new to designing OO systems. I have a simple Flash Cards app where I’m having trouble figuring out the proper way to architect the system. The application has a simple GUI with a question, answer, and couple buttons. The questions and answers dataset are stored in a Derby embedded database.

Quick Setup:
Database Class – Handles the connect,disconnect, and returns an ArrayList based on a selected filter (currently called by a CardSet object) (the DB class is set up as static)
CardSet Class- Holds the ArrayList being used currently, holds the current Card
Card Class – holds the data for the flash card (question and answer, couple other things)
App Class – Creates the GUI and handles the action events

So here is my question: I want to separate the GUI and the application logic. I am thinking it may be a good case for MVC, but I’m not sure how to really separate it all(never used it) . Does a controller class get created in the main which then launches the GUI and then creates the other classes (in my case, the CardSet). What about access? Do certain things need to be static?

Another question- For handling the GUI events, do you just set it up to call a generic method in the controller class? For instance, the “Next Card” button is clicked, should it just call something like controller.nextCardAction()? Should I try to just use the Observer pattern to let the GUI pull the data?

Sorry for the beginner questions, but this is my first go around at a Java app. Any help would be great. Good links are welcome as well. I have the Head First Design Patterns book, but it just doesn’t have enough real examples for me to fully grasp it for my app.

  • 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-15T16:36:26+00:00Added an answer on May 15, 2026 at 4:36 pm

    Here’s a very simple example and discussion that may be helpful.

    Where would you read the DB stuff?

    I’d expect the model to maintain a reference to the current CardSet, initializing it to some default on construction and refilling it whenever the controller says the user wants a new set. Only the CardSet knows where Cards come from or how to get a new set. In response to user action, the view asks the model for the next or previous card, and updates itself when it hears back from the model to which it is listening.

    Don’t confuse the controller with controls: both the view and the controller may manage controls such as buttons. In the example cited, the controller has a reset button, while the view has a panel of game buttons. In your application, the controller might initiate changing sets, while the view has controls to move among the cards in a set.

    For reference, the solid lines in the MVC diagram are method invocations and the dotted lines are callbacks to the listener. In the example cited, the Observable and Observer classes provide the update() callback, but the EventListenerList mechanism is also common.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
We're building an app, our first using Rails 3, and we're having to build
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I am doing a simple coin flipping experiment for class that involves flipping a

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.