Sunday, 29 September 2013

How to name a class and its "real world" counterpart

How to name a class and its "real world" counterpart

I've no idea how to ask for this correctly so please be patient with me. :)
I have a class which is kind of abstract - but not in the OOP sense of
abstract. I will instantiate this class just like any other class. Then
there is its "real world" counterpart that basically represents the
"physical representation". A good example for this is an exam. A basic
exam may be represented by all its questions and all possible answers plus
how much points you get for each correct answer. Then there is the "real
world" exam that represents the physical exam that's taken by the student.
It contains all the chosen answers and a reference to the student.
So I basically ended up with an Exam class - of course - and two other
classes: WorkableExam (when it's handed out) and PerformedExam (when it's
done). So while Workable and Performed might be complete nonsense I still
have a problem if they would be just one class. So, what do I do? Exam vs.
SomeOtherExam - how do I name them? They are both exams right?
I hope some of you get the point. My explanation might be a little bit
fuzzy but this confuses the hell out of me so I'm just totally clueless.
But to put it in once single question: How do I name classes - in general
- when I hit this problem?

No comments:

Post a Comment