Results 1 to 3 of 3
- 04-26-2012, 12:52 AM #1
Member
- Join Date
- Apr 2012
- Posts
- 12
- Rep Power
- 0
Using MVC architecture... file input question for a Swing-based GUI.
I'm trying to create a swing-based bank account program. I have the Account model, which contains the name, ID, and balance, as well as various get and set functions and conversions. I have the JFrame view, which contains a comboBox filled with the selectable accounts, and upon selecting one, it displays an editable field. I have the Controller, which runs the view and model and the actionListeners.
I'm inputting my accounts from a file. To do this, I basically make an array of Account[] and fill in their name, id, balances for each account. My question is, do I put this code in the Model, or the controller? Either way it has to be passed to the view so that it can display the accounts, but I'm not sure where to stick it.
Thanks!
- 04-26-2012, 01:16 AM #2
Re: Using MVC architecture... file input question for a Swing-based GUI.
Data belongs in the model. The model doesn't pass the data to the view; the view queries the data from the model. There's a subtle difference.
dbIf you're forever cleaning cobwebs, it's time to get rid of the spiders.
-
Re: Using MVC architecture... file input question for a Swing-based GUI.
Similar Threads
-
Using MVC architecture in a Swing GUI program?
By AWJustAGuy in forum New To JavaReplies: 2Last Post: 04-24-2012, 06:57 AM -
Review of a new architecture for Enterprise Portals based on Ajax
By Sergei Sokolov in forum Java SoftwareReplies: 0Last Post: 03-15-2011, 09:51 AM -
Question about architecture
By sdmente in forum Advanced JavaReplies: 7Last Post: 07-28-2010, 02:07 PM -
Reading data from csv file based on specific input
By jaiminparikh in forum Advanced JavaReplies: 14Last Post: 02-13-2009, 10:07 PM -
Java based Web Application architecture
By AmmarKhalid in forum New To JavaReplies: 1Last Post: 11-05-2008, 09:20 AM
Bookmarks