Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have a Django application and a PyQt application that share a lot of code. A big chunk of the PyQt application are copied verbatim from the Django application's views. As this is a game, I have already an engine.py module that I'm sharing among the two applications, but I was wondering how to restructure the middle layer (what in Django corresponds to the largest part of the views minus the return HttpResponse part) into its own component.

In the web application the components are those of a classic Django application (with the only exception that I don't make any use of models):

  • the game engine
  • the url dispatcher
  • the template
  • the views

My PyQt application is divided into:

  • the game engine
  • the UI definition where I declare the UI components and react to the events (basically this takes the place of the template and the url dispatcher in the Django app)
  • the controller where I instantiate the window object and reproduce the methods that map the views in the Django app
share|improve this question
Cheers superM Patters / Patterns was a good catch! :) –  Lorenzo Oct 31 '12 at 16:25

1 Answer 1

You have divided your code into modules. It is more important to define the interfaces between the models. The rest will fall into place.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.