September 04, 2010, 01:57:42 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  Home Help Media Affiliates Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Designing the Swing Applications  (Read 1704 times)
0 Members and 1 Guest are viewing this topic.
jurka
Staff
Member
*
*

Reputation: 5
Offline Offline
Posts: 188
Referrals: 0

Awards
« on: July 21, 2008, 12:17:08 PM »

Ok i have been learning how to make smaller single frame Swing APP-s, but i dont know how to make bigger application, the biggest problem for me is the data sharing between frames and classes. I usually make all frames and dialogs in different classes, and share data by passing it in parameters. Is it right to do ? One example how would you implement the use of some logger class, do you create in every class new instance or do something else ?
Logged
Javaforums.net :: a community about Java software development.
« on: July 21, 2008, 12:17:08 PM »

 Logged
Arkie
Javaforums.net Admin
Senior Member
*

Reputation: 16
Developer @ Javaforums.net
Offline Offline
Posts: 2620
Referrals: 13

WWW Awards
« Reply #1 on: July 21, 2008, 12:40:19 PM »

I just use the MVC model (Model-view-controller) to code my software. The MVC model seperates the data from the view and it's a good practice to apply in every application you write.



You can also read the wiki link here about the MVC: http://en.wikipedia.org/wiki/Model-view-controller 

Logged

Java and .NET developer

To students: It doesn't matter how hard you've studied; the material won't be on the exam anyway.

Fan of http://www.retardedweblogger.com
Oh man, too much stuff to do in so little time.

http://img222.imageshack....707/arkietomatoesmall.jpg
Blizzcon 2k9 Grubby and Cassandra Ng engaged ! <3
Triple D, eerste Denken Dan Doen
jurka
Staff
Member
*
*

Reputation: 5
Offline Offline
Posts: 188
Referrals: 0

Awards
« Reply #2 on: July 21, 2008, 01:41:53 PM »

yeha that's true i have used MVC in php, but not in java, i dont know how to implement it. Events are like controllers ? And separate object classes are models?
Logged
Arkie
Javaforums.net Admin
Senior Member
*

Reputation: 16
Developer @ Javaforums.net
Offline Offline
Posts: 2620
Referrals: 13

WWW Awards
« Reply #3 on: July 21, 2008, 02:28:37 PM »

yeha that's true i have used MVC in php, but not in java, i dont know how to implement it. Events are like controllers ? And separate object classes are models?



Model-View-Controller

The ideas behind MVC are quite old, developed during the 1970s. The invention of MVC is attributed to Trygve Reenskaug, who was working at Xerox PARC at the time.

The idea is to break up an application into three parts:
  • A model that holds part of the current state of the application. In this article the state of a model is represented by a set of properties. A property is implemented as a getter and a setter method, as in the JavaBeans concept.
  • A view that is, for whatever reason, interested in knowing the current state of the application. A view registers itself with a model as a listener on the model. Whenever the state of a model changes, the model notifies its registered listeners. In GUI programming, a view often does nothing more than display the state of the model through some graphical component.
  • A controller that changes the properties of the model. When and how a controller changes a property is at the discretion of the controller. In GUI programming, a controller is often something that takes input from the user; for example, a button or a text field.

http://www.enode.com/x/markup/tutorial/mvc.html and http://www.onjava.com/pub...004/07/07/genericmvc.html these two links might help you to learn more about the mvc model. If you have any other questions let me know.
Logged

Java and .NET developer

To students: It doesn't matter how hard you've studied; the material won't be on the exam anyway.

Fan of http://www.retardedweblogger.com
Oh man, too much stuff to do in so little time.

http://img222.imageshack....707/arkietomatoesmall.jpg
Blizzcon 2k9 Grubby and Cassandra Ng engaged ! <3
Triple D, eerste Denken Dan Doen
Javaforums.net :: a community about Java software development.
   

 Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Your Ad Here
Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Valid XHTML 1.0! Valid CSS!
Page created in 0.275 seconds with 36 queries.

Google visited last this page Yesterday at 04:57:59 AM