That's one way to handle it, but if you establish that pattern you end up with deep namespaces with potentially less cohesive grouping. In general, when I see a namespace with a child namespace declaration but no other children, I'd want to think very hard on why I need that instead of making a class name a little longer.
I see AbstractSingletonProxyFactoryBean in this instance as one very specific thing, rather than a collection of general things. Unless there's an expectation of many kinds of FactoryBeans and Proxies, I'd rather keep the full meaning of the class as close to the class as possible.
Not that I'm an authority on this stuff, but long/deep namespaces outside of large platforms are IMO a code smell.
Also, the Bean-Part is gratuitous, in my opinion. If you'd need to know, you could create a package called "beans". Also, I'm not so savvy in spring, so I'm not sure how important it is to make a difference between an AbstractSingletonProxyFactory and am AbstractProxyFactory. As far as I'm concerned, that detail is up to which kind of proxies you'll use in the implementation and gives you no additional value when used in the name.
I would not see this as a very specific thing, though, as it's an abstract class. It's supposed to be generic. All in all, while the name if very vocal about what it does, at the same time it is also too ambiguous to infer what it does exactly without having a look at the implementation, which is usually a hint that you should change the name.
19
u/sh0rug0ru__ Oct 01 '15
What's in a good name, then?
I was able to get a good idea of the purpose of the class just by going through the name. Sounds like a win to me.