3 Replies - 412 Views - Last Post: 30 August 2013 - 02:41 PM Rate Topic: -----

#1 liherb  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 21
  • Joined: 25-November 12

Best practice for generalizing and documenting each method's behav

Posted 30 August 2013 - 11:00 AM

I'm starting a small project coding in Python as I learn the ropes. As the project grows bigger, there are more and more overlapping and even redundant methods. For example, several classes have a checkAndClean_obj_state() method. If just one or two such classes, it is easy to analyze the behaviour of them and design the optimal interaction for all objects. However, when there are many of such classes, exactly at what point to invoke check and clean behaviour becomes a little blurred. There is a desperate need for generalizing and documenting the behaviour of each such class, preferablly in a flowchart. I'm currently doing the flowchart manually but the job becomes a bit overwhelming.

I wonder what Python pros are using for analyzing and documenting classes/functions behaviours and interactions? Is UML the only way? Personally I found UML is a bit overkill for a one person project, but I'm not sure if it is the right direction. I'd appreciate any insght. Many thanks.

Is This A Good Question/Topic? 0
  • +

Replies To: Best practice for generalizing and documenting each method's behav

#2 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3805
  • View blog
  • Posts: 13,487
  • Joined: 12-December 12

Re: Best practice for generalizing and documenting each method's behav

Posted 30 August 2013 - 11:26 AM

Are you using docstrings for your classes and methods? If so I'm assuming that there might be tools/libraries available that can create a visual representation from these(?).

Otherwise, someone else might be able to recommend an approach, or tool.
Was This Post Helpful? 0
  • +
  • -

#3 liherb  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 21
  • Joined: 25-November 12

Re: Best practice for generalizing and documenting each method's behav

Posted 30 August 2013 - 12:30 PM

Thanks for the reply. Yes I'm using both docstrings and inline comments. I'd really love to get some advice on how I can use a library to automatically get the graphical flowchart out of it!
I'm using Ubuntu, by the way.
Was This Post Helpful? 0
  • +
  • -

#4 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3805
  • View blog
  • Posts: 13,487
  • Joined: 12-December 12

Re: Best practice for generalizing and documenting each method's behav

Posted 30 August 2013 - 02:41 PM

A quick search uncovers this EpyDoc feature, although it doesn't seem to have been updated recently. linux version

Added: Mm on a second look, it may not automatically produce formatted output - may require a little configuring/programming.

Maybe someone else has a recommendation.

This post has been edited by andrewsw: 30 August 2013 - 02:45 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1