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
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