This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes How to document requirements, design of classes/code properly before coding begins ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to document requirements, design of classes/code properly before coding begins ?" Watch "How to document requirements, design of classes/code properly before coding begins ?" New topic

How to document requirements, design of classes/code properly before coding begins ?

Andy Jack
Ranch Hand

Joined: Nov 22, 2012
Posts: 257
I saw a couple of diagrams in random java related searches on google. They arrange the class members systematically. Some even mentioned the functionality/purpose of each member.

I feel that my approach to coding lacks all these "formal" things and is very disorganized. All i do is, think something and start coding almost immediately. Later, I realize that my design is not so good and I have to
redo almost half my code.

I want to get my requirements and documentation right before I begin. I don't want design and documentation as an after thought.

Any suggestions on how to go about it ?

Java Newbie with 72% in OCJP/SCJP - Super Confused Jobless Programmer.
I am a "newbie" too. Please verify my answers before you accept them.
Stuie Clarky
Ranch Hand

Joined: Nov 09, 2012
Posts: 73

Have you ever come across use-case diagrams, entity relationship diagrams, dataflow models etc? They are a pretty standard way to capture the goal and functionality of a piece of work without being language specific. You could even break your work into different areas and have documentation for each area. Ultimately the time spent thinking and planning (however you do it) before you start coding will save you many times the amount of refactoring and redesigning at a later stage.

Rajdeep Biswas
Ranch Hand

Joined: Mar 26, 2012
Posts: 186

I dont have detailed knowledge on ERD and DFDs. I know that I can, from requirements specification document,
- understand in abstract what has to be done,
- figure out what classes and tables etc I have to create and what I have to use (created by others)
- can draw a diagrammatic representation connecting all the classes and databases as I would like to,
then I
- can write down the implementation details, as how would I do it, then
- write all the Unit Test cases
- then REVIEW

And then start coding.
Kemal Sokolovic

Joined: Jun 19, 2010
Posts: 825

Probably the only suggestion you can get is you start learning UML if you already didn't.

Formally defining requirements at the beginning of the project is very important. Discovering requirement mistakes in early phases will save you a lot of time and money later. Though requirements always tend to change and evolve (yes, clients are very strange creatures) you need to make sure you first agree with your client about the requirements you specified formally before you start actually working on them because that's probably the only connection between you two in early phases.

Designing software is all about thinking at the higher lever of abstraction, leaving implementation details aside. We all (software developers) get goose bumps when we hear something like high level of abstraction or something prefixed with meta, and designing is all about that. So it tells you it is probably a good practice, especially in terms of maintainability.

Depending on the project you can choose how deep you want to go into design before you start implementing a solution. In any case, UML is there as a tool for you to specify all you need. The way you iterate over different phases before or during implementation is a matter of method you use for development, which is also an important thing to keep in mind.

I suggest you take a look at the UML website for some more details, find a software that you can use for UML modeling and start learning.

The quieter you are, the more you are able to hear.
I agree. Here's the link:
subject: How to document requirements, design of classes/code properly before coding begins ?
Similar Threads
Documentation for SCJD and best practices!
Rational Rose alternatives
Manufactoring vs. Design
Pass Part 2 and 3 with100% - my experience
code vs. design