As Masem said, there is nothing wrong with different classes sharing the same method names. That's usually good design.
I recommend designing the three different Semantic classes, if you find any substantial amount of commonality, look into interitance. It seems to me that the Entry checker is the simple one, Dictionary checker does a bit more work, and then your last checker does even more work. This might be a good candidate for aggregation, where the Dictionary checker passes off some of it's responsibilty to the Entry checker, maybe. TIMTOWTDI, especially in OO design.
I heard Flyweight pattern mentioned in the chatter yesterday. Here is a brief explanation taken from Design Patterns (the GoF book):
In other words, the character code being stored in a given flyweight is called intrinsic state, it is information independent of the flyweights context - whereas the info about the character's position and font are passed to the flyweight object by the client when it need them. This information depends upon the flyweight's context - this is known as extrinsic state.
So, do you need to implement the Flyweight pattern on this problem? Probably not - the Flyweight would only be good if you had started with it, and had more than 3 objects in question. So at this point, i recommend going ahead with your original idea, and call each method from Entry, Dictionary, etc. the same - semcheck() works for me. ;)
Every problem is different, and as such, each implementation will have subtle differences. Does code A belong in object foo or bar. Try both and see which is the most flexible, and which is simplest.
jeffa
L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
F--F--F--F--F--F--F--F--
(the triplet paradiddle)
In reply to (jeffa) Flyweight Pattern
by jeffa
in thread Question to OO Masters (about Style)
by PetaMem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |