Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: How do you design a complex program

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How do you design a complex program

    I was wondering if anyone knows of a book dedicated to designing a complex system, I'm not talking about code construction but the actual designing of a program. Something that helps with core requirements, layout, etc.


  2. #2
    Member
    Join Date
    Feb 2010
    Location
    Auburn, AL
    Posts
    31
    Thanks
    0
    Thanked 8 Times in 8 Posts

    Default Re: How do you design a complex program

    Same way you eat an elephant - with a work breakdown structure.

    (Sorry, couldn't resist. Please ignore.)
    Let me know what you think of my website:
    http://www.auburn.edu/~carpept
    Comments or suggestions are appreciated!

  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,296
    Thanks
    180
    Thanked 824 Times in 767 Posts
    Blog Entries
    5

    Default Re: How do you design a complex program

    I'm not sure of any particular book that lays out the steps one by one, possibly because every concept is context dependent and one context may require concepts that would be detrimental in another context. That being said there are some books/websites that lay out some fundamentals that are a good foundation - in particular is a book called "Design Patterns" written by the "Gang of Four". You might just skip finding a copy of the book though and just google "java design patterns", from which you can extract all the concepts and more.

  4. #4
    Junior Member
    Join Date
    Mar 2010
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How do you design a complex program

    I've actually been reading that book. It is a good find. However, what I was really looking for was a way to keep an overview of my program so that I can see how my program interacts, what functions exist where, etc. UML seems to be exactly what I need.

  5. #5
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: How do you design a complex program

    UML is great in the pre-coding and quite useful during coding to keep your code on track.

    Here are some tips for the actual programming/testing of your project. Note that UML probably takes precedence over this because it will dictate how your program is structured, but at some point you will actually need to code out the program and make sure it works.

    There are several helpful tools that you can use while coding. For large projects, while it is possible to try and use a notepad and command-line compile everything, it is simply impractical. The use of a good IDE can greatly improve productivity.

    Good features to look for in IDE's when designing large projects:

    1. Debugger. This should be in an IDE even worth thinking about using. The vast majority of the time spent in the whole application design process will be spend debugging (preferably as your coding so you know a certain piece works). A good debugger can make the difference between taking hours or even longer to fix a problem to something that can be fixed in a few minutes (note that there will still be a lot of times you will be stuck debugging code for ours or even days even with a debugger). The features in debuggers are for the most part fairly standard, but do vary slightly from IDE to IDE (I think most Java IDE's use jdb, the debugger that comes with the JDK). There's a breakpoint, continue code execution, execute code line-by-line, termination of the program, and method call stack and variable/field tracking.
    2. Outline/Hierarchy. The outline helps you to keep track of what methods/fields you have in a particular class (or even across multiple classes). It can also help you to re-organize chunks of your code to make finding certain pieces of code easier.
    3. Refractor. A very helpful tool that helps you rename variables/methods/classes etc.
    4. Source Control. This doesn't actually need to be in the IDE, but some form of source control is a very good idea for large projects. Source Control keeps track of changes made so you can revert back to a version of code that works if it accidentally gets messed up. Source Control also can helpful when a project is being developed by multiple people.
    5. Auto-complete/Auto-format. These aren't the most necessary tools, but Auto-complete will help you find the correct function/class/field etc. as you type it in. Auto-format is slightly more useful than Auto-complete because it can help you to enforce a coding style, extremely useful when there are multiple people working on some code. The last thing a developer needs is to try and figure out what a piece of code does because it was poorly formatted, or formatted in a strange way.

    There are many other tools offered by different IDE's (GUI designer, automatic source generation for getters/setters/constructors etc.) that are very useful, but not really that essential. Price may also be a factor (Java is pretty lucky, it has at least two extremely good IDE's that are both completely free/open source and widely used).

    Effective use of a debugger can take a while to learn, and there are many other good tutorials on how this is done. Usually the most important part of debugging though is testing as small a chunk of code as possible, preferably when it has barely been written and still fresh in your mind. Once you know that a part of your code works, you can essentially forget about debugging that portion ever again (unless it gets changed) and focus on looking for problems elsewhere.

    Here's a tutorial on debugging with Java: Use the Java Debugger to Determine the Causes of Errors. Most tutorials on debugging with any language can also be used, just keep in mind that different languages sometimes have different issues crop up (like in C/C++, pointers are probably the number one source of problems, but in Java there aren't really any pointers and memory management isn't a big source of problems usually).

    The last (and arguably the most important and often the most ignored) thing you can do while coding is Document!
    Good documentation/JavaDoc is probably the best thing that you can do during coding, especially if you are working with other people, or even if you are working alone. (could you imagine trying to use the Java SE API without any Javadoc? or even writing the Java SE API without proper documentation?)

  6. #6
    Junior Member
    Join Date
    Mar 2010
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How do you design a complex program

    Thanks for taking the time to respond to my question. First off, I use Netbeans. I love it and it's awesome for Java and even decent for PHP. I can't understand how anyone would use Notepad, it's so awful for development and there are plenty of good free IDEs. I'm pretty familiar with the tools actually. My main issue had to do with keeping it all organized.

Similar Threads

  1. Design question about maps
    By KaleeyJ in forum Java Theory & Questions
    Replies: 1
    Last Post: February 2nd, 2010, 03:17 AM