Private methods
Dieter Maurer
dieter at handshake.de
Thu Oct 11 02:04:50 EDT 2012
alex23 <wuwei23 at gmail.com> writes:
> On 10 Oct, 17:03, real-not-anti-spam-addr... at apple-juice.co.uk (D.M.
> Procida) wrote:
>> It certainly makes it quick to build a class with the attributes I need,
>> but it does make tracing logic sometimes a pain in the neck.
>>
>> I don't know what the alternative is though.
>
> Components.
>
> The examples are in C++ and it's about game development, but I found
> this article to be very good at explaining the approach:
> http://gameprogrammingpatterns.com/component.html
>
> I've become a big fan of components & adaptation using zope.interface:
> http://wiki.zope.org/zope3/ZopeGuideComponents
If multiple inheritance is deemed complex, adaptation is even more so:
With multiple inheritance, you can quite easily see from the source
code how things are put together.
Adaptation follows the "inversion of control" principle. With this
principle, how a function is implemented, is decided outside
and can very easily be changed (e.g. through configuration).
This gives great flexibility but also nightmares when things do
not work as expected...
More information about the Python-list
mailing list