2 ms·
How do you name your classes instead? I ask because I'm now mostly in favor of naming classes after the patterns, at least when there's no relevant term from th
by codeflo 9y ago
How do you name your classes instead? I ask because I'm now mostly in favor of naming classes after the patterns, at least when there's no relevant term from the domain to use. That is, when the alternative is to invent a new abstract name, I think it's better to use the one that comes with the design pattern. The resulting names are often ugly, but at least they clearly communicate the intent to people also familiar with the pattern.
- BatFastard 9y agoWhat are some examples of names you find yourself using a frequently. Do you use PatternIdentifier or IdentifierPattern pattern? ie. UserInfoProxy or ProxyUserInfo?
- hliyan 9y agoIf there's no relevant term from the domain, that's an indication (at least for me) that the class hierarchy is wrong. I've been programming for 15 years and I've never found myself without a proper domain-oriented name for a class...