best practice to resolve module dependency within a reusable application

Discussion in 'Python' started by Marc Aymerich, Mar 22, 2011.

  1. Hi,
    I'm developing a reusable app splited into modules. The end user
    chooses what modules wants to keep installed.
    Most of this modules are quite independent from each other, but I have
    one of them (called moduleP) with a pretty strong dependency with
    another another(called moduleBase). So I need to change some of the
    moduleBase behaviour whenever moduleP is installed.

    What is the best practice to resolve this dependency in a reusable
    scenario?
    Where should the specific moduleP code for moduleBase live? in moduleP
    or in moduleBase?

    I thought in two possible solutions:

    1) moduleP specific code lives in moduleBase an it is called if "is
    moduleP installed":

    class moduleBase(otherClass):
    def method(self):
    super(moduleBase, self).method()
    # moduleBase stuff
    Marc Aymerich, Mar 22, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Folke
    Replies:
    0
    Views:
    816
    Folke
    Nov 11, 2003
  2. Replies:
    1
    Views:
    10,112
  3. Nemisis
    Replies:
    1
    Views:
    500
    Mark Rae
    Apr 4, 2007
  4. Trevor
    Replies:
    3
    Views:
    911
    Philip Semanchuk
    Jun 16, 2010
  5. Bernard Lambeau
    Replies:
    6
    Views:
    157
    Bernard Lambeau
    Jan 14, 2011
Loading...

Share This Page