I have the following situation in which I cannot come up with a good way to define an object's state. This is an application designed to test another application, a website. The classes involved are Central, helper1, helper2 and so on. There are about 10 helper-classes, which specialize in different part of the website.
The Central-instance (call it cen) has the instances of all the helper classes. In the software, tests run cen and it runs the helper-instances. For the most part, cen takes care of its own status (of course). The status is essentially where on the website the browser (and thus the entire software) is.
But,
there are situations where the helpers have to set the status.
I thought I don't want to merely define an attribute and getter and setter for it. That would create more coupling. I guess I don't mind if the cen knows the helpers, nothing wrong with that but the other way around..
At first I thought, of course, enum would solve it. Python doesn't do those. There are various ways to implement them but I was thinking: is there a more simpler way? Perhaps another way which isn't anything like enums ?
Help is appreciated.
Thanks.
Edited by denarced, 12 November 2010 - 10:52 AM.
brainfart


Sign In
Create Account


Back to top









