<html>
<body>
At 10:39 AM 2/11/2005, Ryan Davis wrote:<br>
<blockquote type=cite class=cite cite=""><font face="courier" size=2>I'm
starting to make a code-generation suite in python, customized to the way
we ASP.NET at my company, and I'm having some trouble finding a good way
to organize all the code.&nbsp; </font></blockquote><br>
My take on doing that in Python:<br><br>
Organize things into modules. Especially with an eye to potential reuse.
Look at the module index in the docs to see how most of the
&quot;standard&quot; modules focus on doing one thing well.<br><br>
Within a module create classes for every conceivable object. Whenever you
find yourself writing an if statement ask whether this would be better
handled by subclasses. Whenever you find yourself about to write a global
statement, consider making the variables properties of a class.<br><br>
Within classes create methods applicable to those classes. Within
subclasses create methods applicable to those subclasses.<br><br>
<blockquote type=cite class=cite cite=""><font face="courier" size=2>I
keep writing it, but it feels more and more spaghetti-ish every 
day.<br>
&nbsp;<br>
I'm going to look at the other stuff in site-packages to see if I can
glean any wisdom, and have googled a bit, coming up mostly blank or with
trivial examples.&nbsp; Are there any helpful links or advice anyone has
for building larger systems?&nbsp; <br>
&nbsp;<br>
My background is mostly C#, so I'm used to the ridiculous rigidity of
strongly-typed languages. I have been using python for helper apps for a
few months now, so am pretty familiar with the syntax now, but I don't
know any of the patterns yet.&nbsp; My nefarious goal is to supplant
C#/ASP.NET with Python, but I need to figure out how to make programs
clients want to pay for before I can make any reasonable argument.<br>
</font><br>
<font face="Times New Roman, Times" size=2>Thanks,<br>
Ryan<br>
----<br>
Ryan Davis<br>
Director of Programming Services<br>
<a href="http://www.acceleration.net/">http://www.acceleration.net/</a>
<br>
</font><font face="Times New Roman, Times">&nbsp;<br>
</font>_______________________________________________<br>
Tutor maillist&nbsp; -&nbsp; Tutor@python.org<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" eudora="autourl">http://mail.python.org/mailman/listinfo/tutor</a></blockquote>
<x-sigsep><p></x-sigsep>
Bob Gailer<br>
<a href="mailto:bgailer@alum.rpi.edu" eudora="autourl">mailto:bgailer@alum.rpi.edu<br>
</a>303 442 2625 home<br>
720 938 2625 cell</body>
</html>