What tools do you use to outline projects?

Whenever I start working on projects that are complex enough that I can't get my head around, I like to describe how the application should work ... I usually sort it out in a text editor somehow:

# Program is run
#     check to see if database exists
#         create database
#             complain on error, exit
#     ensure database is writable
#         complain to user, exit
#     check to see if we have stored user credentials
#         present dialog asking for credentials
#             verify credentials and reshow dialog if they're invalid
#     show currently stored data
#     start up background thread to check for new data
#         update displayed data if new data becomes available
#     ...
# 
# Background service
#     Every 15min update data from server
#     Every 24 hours do a full sync w/ server

      

Et cetera (note: this is a comment, so SO won't parse it, not because I include it in the comments in the code).

I'm wondering how you guys do it. Are there any tools for describing the flow of a program? How do you describe complex projects so that when it's time to code, you can focus on the code rather than the design / architecture of all the little pieces?

+2


source to share


9 replies


I use GraphViz if I need to sketch out such simple diagrams - the DOT language is lightweight and differs very well when I compare versions of the diagrams.

I wrote about this with an example a few months ago with an example showing a more complex architectural diagram.

I have also added a blog post with a larger diagram that shows a large flow of the program to give an idea of ​​how the GraphViz flow can be composed. I don't have time to obfuscate all the text, so just put it there like a low-res image to give the impression of architecture without being able to zoom in to see the details readable.



This diagram was compiled by hand after a bunch of grepping to get it up and running. To avoid too much ridicule, here are some excerpts of the DOT text that the diagram generates.

digraph windows {
 rankdir=LR
 label="Windows Invoked\nby controls and menu items"
 node[fontsize=12]

/* ENTRY POINTS */
 wndMainMenu[shape=box color=red fontcolor=red]
 DEFAULT_WINDOW[LABEL="DEFAULT\NWINDOW" shape=box color=red fontcolor=red]


/* WINDOWS */ 
 node[shape=box color=black fontcolor=black style=solid]
 App
 wndAddBill [label="Add Payable\nwndAddBill"]
 wndAddCustomer [label="Add a Customer\nwndAddCustomer"]

...

/* WINDOW INVOCATION */
 node[shape=oval color=blue fontcolor=blue style=normal]
 edge[fontsize=10 style=normal color=blue fontcolor=blue]

 wndPayBills_bvlNewBill -> wndAddBill 
 wndAddCustomer -> wndAddCustomer_save001
 wndManageDrivers_bvlNewCustomer -> wndAddCustomer 

      

alt text http://www.aussiedesignedsoftware.com/img/WindowLaunchesZoomedOut.png

+2


source


Emacs Mx outline mode

Or, paper.



ps this is a serious answer.

+1


source


Basically what you are trying to do is extract information and use cases in a Given-When-Then format. http://wiki.github.com/aslakhellesoy/cucumber/given-when-then . This approach solved both problems.

  • understanding domain and edge cases
  • defining a solution so you know what to do next, in addition to where to start
+1


source


For anything related to documentation: Wikis, Wikis, and more! Easy to read and, most importantly, easy to update.

My favorite: Trac (much more than just a wiki)

0


source


Are there any means to describe the flow of a program?

Your best comments ("The program is running") can be expressed using a "flowchart".

Your bottom comments ("Background Service") can be expressed with a "data flow diagram".

I am not using flowcharts (I do not believe they add value over the corresponding pseudocode / text as you wrote it), but I do like data flow diagrams for top-level display (i.e. data stores / formats / locations and data processing / IO steps). However, data flow diagrams predate the UML, so their descriptions are not available on the web.

0


source


I like sequence diagrams for anything in the OO field. There are some good ways to create sequence diagrams without spending all your time getting polygons around.

First, there are some sequence generators that accept text input. See WebSequenceDiagrams.com for example .

There's also a nice Java based tool that takes text input and creates diagrams. This is good for integrating into your build process because it can be called directly from ant.

0


source


If something is difficult, I like the pictures, but I try to do it by hand on paper, so I can visualize it better. Boards are great for this.

I break down a large or complex application into smaller pieces and develop them on paper so I can better understand the flow between the pieces.

Once I have a flow between the executed parts, I can better design each part separately, since each part is its own subsystem, so I can change languages ​​or platforms if I want.

At this point, I just start working on the application and just work on one subsystem at a time, although the subsystem may have to be decomposed until I have a piece to keep in mind.

0


source


  • Use cases
  • Action diagrams
  • Sequence diagrams
  • Machine State Diagrams
  • Class diagrams
  • Database diagrams
  • Finally, after they are done and the project is well defined, in Microsoft Project.

I like to maintain this flow as it documents well, defines it clearly and explains easily, not to mention that it is just a good process. If you don't know what it is, take a look at my answer here for more information as well as some links.

0


source


I recommend using the UML. There are various depths that you can use when designing. If you take the UML far enough, most UML applications can automatically generate the basic structure of your code for you.

Typically, I rely on fluent UML to generate use cases, use case diagrams, class diagrams, component diagrams, and more using sequence diagrams.

Depending on the project, a whiteboard or notepad works, but for a project of reasonable size and time, I'll do everything using ArgoUML. I've used StarUML in the past, but it's only Win32, which is no longer useful to me.

An excellent book on the subject Using the UML and Patterns: An Introduction to Object Oriented Analysis and Design and Iterative Development (3rd Edition) - [978-0131489066]

I had to pick it up for a college course that did a tiny job teaching the UML, but kept it and read it once or twice since then.

It's also worth checking out: Learning UML 2.0 - O'Reilly - [978-0596009823]

0


source







All Articles