best practice to resolve module dependency within a reusable application

M

Marc Aymerich

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top