I am having troubles with dependencies between two classes. The problem is the following:
I got two classes, Timestamp and Exception. Exception is abstract and all possible exceptions derive from this abstract class. Every exception has a timestamp to tell when the exception was thrown. So exceptions need to include (in the language i am using it is called import) the timestamp class. But wen working with timestamps errors can occur, so that exceptions are thrown. Therefor the timestamp class has to import the exception classes.
And there is my cyclic dependency. Now my actual question is (and this is why it is independent from the language): What would be a proper design in such a case to avoid cyclic dependencies? I fail to solve this problem as I cannot figure out a solution to have this classes as independent as they are now but without the cyclic dependency.