# Redux: Circular Imports (Tim Cook) **Category:** [Implementers (archive)](https://discourse.openehr.org/c/implementers-archive/158) **Created:** 2008-07-04 01:18 UTC **Views:** 9 **Replies:** 0 **URL:** https://discourse.openehr.org/t/redux-circular-imports-tim-cook/12907 --- ## Post #1 by @Max_Young There's nothing wrong with a class defining a reference to another \(or the same\) instance of that class \- that's how most hierarchical OO implementations would work\. I don't know Python \- but other languages certainly won't worry about this \- it's not a circular reference in as much as the reference is \(at run time\) to an instance of a class of the same type which may be the same object, but generally would not be\. In the case of the thumbnail attribute it does mean a thumbnail can have a thumbnail can have a thumbnail, for example \- not likely but possible in the model\. Not circular but hierarchical\. For storing/retrieving there then needs to be implemented some mechanism for 'walking' the structure from object to object \- and if there is a circular reference there, it needs to be dealt with \(usually by flagging each object as it is dealt with\) I'm not sure I read your email right, though \- as you said you defined ontology in IArchetype? Maybe I'm missing some Pythonism but I would have had IArchetypeOntology implementing IArchetype, and ArchetypeOntology implementing IArchetypeOntology Eg in C\#     public interface IArchetype   \{\}   public class Archetype : IArchetype   \{\}   public interface IArchetypeOntology : IArchetype   \{     Archetype ParentArchetype \{ get; set;\}   \}   public class ArchetypeOntology : IArchetypeOntology   \{     private Archetype parentArchetype;     public Archetype ParentArchetype     \{       get       \{         return parentArchetype;       \}       set       \{         parentArchetype = value;       \}     \}   \} And I can have       Archetype a = new Archetype\(\);       ArchetypeOntology b = new ArchetypeOntology\(\);       b\.ParentArchetype = a; Sorry if I have missed the point entirely \- my first post; Max --- **Canonical:** https://discourse.openehr.org/t/redux-circular-imports-tim-cook/12907 **Original content:** https://discourse.openehr.org/t/redux-circular-imports-tim-cook/12907