Server programming

Steve Holden steve at holdenweb.com
Mon Feb 23 12:57:05 EST 2009


koranthala wrote:
> Hi,
>       Is server programming in Python procedure oriented or object
> oriented?
>       I have this question because lately I am asked to make a medium
> complex web program (extremely database oriented) using Django. When I
> used to do application programs earlier (in Python itself), the whole
> thing being object oriented came out easily in programming. So, I was
> able to use different patterns etc for programming and the whole thing
> was - quite fun to design and create.
>       But when I program in Django, since I just have to work on user
> responses - everything else being taken care of by Django - only, the
> complete coding has become procedure oriented. It is not kludgy or
> anything, but it doesnt have the nice feeling that we get when we code
> a proper object oriented program.
>       Is my coding in error here? This is infact my first web program,
> so it might be the reason. What does other people find? Does web
> server programming using web frameworks (Django, TurboGears etc) make
> it procedure oriented? If I am in the wrong, it might be due to a
> wrong design or mindset, and I would like to change it.
> 
It's just that Django *seems* procedure-oriented because your views are
written as functions. But they take request objects as arguments and
return response objects as results, so the framework is object-oriented.
Also each model is a class, and querysets eventually yield lists of
instances.

I wouldn't worry too much until Django forces you to do somethign you
really don't want to do ...

regards
 Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list