On 8/6/2013 11:36 AM, BrJohan wrote:

Consider a botanical classification system (somewhat analogous to my
'problem' as it effectively is related to classification of entities):

A Domain should know about its Kingdoms,
a Kingdom should know about its Phylums,
...
a Genus should know about its Species.

As some already said, 'a domain' is an instance of Domain (or possibly generic Taxon). We have on Earth one instance of 'Life'.

Of course it is possible to implement such a decision tree as a
'factory'. However, I would rather prefer to encapsulate those decisions
at the class level where they 'belong'.

Each instance could have a .classify function that assigns instances to sub-instance. The master classifier function would only know how to use the .classify functions and have no specific content knowledge in itself.

--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to