how to arrange classes in .py files?

Terry Reedy tjreedy at udel.edu
Fri Mar 27 20:30:00 EDT 2009


Kent wrote:

> thanks you guys' explaination. I did some refactory on my codes. Now
> it look's like:
> 
> myapp/ # this is a package, it is the root package
>    - gui/ # this is package, contains all gui related modules
>         - mainFrame.py
> 
> 
>    - dao.py # all daos are in this module
>    - service.py # all service classes, responsible for handling DB
> connections, Txn mgmt, and Business logic Task (calling daos)
>    - entity.py  # like 'pojo's, in java,
>    - util.py # utils
>    - myapp.py # start main script

Really clear.

> with this structure, import statements were *significantly*
> reduced. :)

Bingo!

tjr




More information about the Python-list mailing list