Efficient Java Software Design

First let me preface my questions by saying I have a great knowledge of Java programming, in terms of how to logically create/solve a task. Where I lack knowledge is in the "big picture" of software design. For the first time, I am developing a fully functional software package and I often find myself confused as to how to efficiently organize and build my software. For instance, one portion of my program involves a JInternalFrame which would hold a JLabel that holds a picture, upon which users plot out data points. I find that I am unsure of what would be the most modular, efficient, upgradeable method of organizing both the GUI and user data. In the example with JInternalFrame, where should mouseevents/keyevents be processed? Where should popupmenus/menubar actions be processed? How should this portion of my program operate in relation to the overall program? How should another portion of the program access this portion's data? These are the type of questions I usually find myself unable to answer. Since this is my first "real" software package I know that I will end up making many many changes to different portions of the package, and if I do not implement an efficient design of organizing data, I will make much more work for myself.

Thank you in advance,
Who is Participating?
NaeemgConnect With a Mentor Commented:
ad a JPanel for your Jlabel that u want user to plot images on it.
don't worry about events, every event will do its own work efficiently.
and while u r reading data u may use threads.
and also u may use thread for ur all events, that, one event is plotting, while other event is available for actions. etc. or reading data.
tell me ur all actions u want to perform ?
aozarovConnect With a Mentor Commented:
I don't think that "were to put your listeners" should be part of your "big picture" when you are designing software.
By applying iterative development you will find yourself applying such related changes without a blink.
Separating GUI handling and data is important and well documented concept (MVC see for e.g. http://c2.com/cgi/wiki?ModelViewController).
There are many other patterns (good development practice) which you can read about and apply when appropriate (see
http://www.javaworld.com/columns/jw-java-design-patterns-index.shtml or http://www.patterndepot.com/put/8/JavaPatterns.htm (free book))
mightyoneConnect With a Mentor Commented:
To make support and updates easier it is good to have a fine granulated and efficient Package design! If you tend to programm rather in new classes than methods a Update could mean just replacing a .class file. but leaving all calling classes intact.

according to your requirements i would suggest to encapsule all your eventhandler and listeners in seperate class files. Another benefit is easier reuse of class files for other projects.

One thing you should always consider is your gui design from point of view Unicode and i18n! This will strongly affect all your gui design from frames down to scrollbars....
All Courses

From novice to tech pro — start learning today.