Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Beginning Java and the fly likes program design and coding style Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "program design and coding style" Watch "program design and coding style" New topic
Author

program design and coding style

david russell
Greenhorn

Joined: Feb 28, 2002
Posts: 14
hey folks,
i was wondering if anyone has any tips on the best method of designing a program. i have a set of requirements and i know fuctionally what the program will do,im just not sure where to put the code, and what should be classes and methods and so on.
does anyone have any tips or preferences for designing/laying out of code?
all feedback is greatly appreciated
dave
Mark Herschberg
Sheriff

Joined: Dec 04, 2000
Posts: 6037
This is a general programming question, I'm moving it to Java In General (Beginners).
--Mark
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Whole books and entire courses are devoted to this topic, and you want it summarized into one post?
The standared answer is
- Look for the "nouns" and make classes out of those
- Look for the verbs and make methods out of those
But of course that is greatly simplified, and if you stick to that TOO closely you miss the big picture.
Jennifer Bhamoo
Ranch Hand

Joined: Mar 09, 2002
Posts: 47
I highly recommend that Just Java book (which JavaRanch also recommends).
I just happened to have that book before I started coming here and it explains everything very nicely. Do you have a programming background? I think this book may be a little confusing if you don't have any programming background, but not sure. Good Luck!
david russell
Greenhorn

Joined: Feb 28, 2002
Posts: 14
hey,
i do have a little experience writing java programs, especially for the j2me spec. ive found a good example of how to lay the code out now, i just have to get on with it!! any tips would still be appreciated though!
dave
David Duran
Ranch Hand

Joined: Feb 11, 2002
Posts: 122
If you're in no rush, writing out your program in pseudo-code, on paper always seems to help. Again, if you're in no rush, planning out the structure of your program, the type of data structures you might want to use, the logic, etc. is always helpful before you actually sit down and write code.
Of course, people depending on you for that program frown when you show them oodles of paper but not one line of code in a program, hahaha.
John Spindler
Greenhorn

Joined: Feb 12, 2002
Posts: 28
I am reading Jacquie Bakers Beginnin Java Objects and currently reading on how to layout static diagrams, sequences diagrams. All of this is being done in UML and I can't stress enough how much it brings your code together and the best part is while your modeling your code you can change it a billion times over without ever having to worry about reconstructing your code. If you model it writing the code will only take you time because everything else is already figured out!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: program design and coding style
 
Similar Threads
Using a java program as a command line...
A (hopefully) simple "Text box" question
labeled tabs across the top of a window
timer
difference between CORBA,EJB and RMI