On Fri, Sep 11, 2009 at 3:59 PM, Marvin Humphrey <[email protected]> wrote:
> And if we accept that all search-related components are going to start with
> Lucy::Search, then an inheritance-driven subclass naming scheme starts to
> yield painfully long fully-qualified class names.
> "Lucy::Search::HitCollector::BitCollector" is 40 characters; a lot of people
> limit their code to 78-80 characters per line, and class names that long start
> to cause awkward wrappings. We don't want to have too many of those.
BitCollector derives from HitCollector and this is something we want
to preserve? There's really no way that they can't just both derive
from Collector the way it reads at first and second glance? Maybe if
it always had to be spelled out you'd stop doing that. :)
> But QueryParser could also go under Lucy::Search. Maybe we should try to have
> all second-level namespacing represent grouping only? In other words, there
> would be no instantiable classes with the pattern Lucy::Xxxx -- only
> Lucy::Xxxx::Xxxx and deeper.
This would make me happier. And this would make things easier to
align with the C scheme, right?
> If we arrange things this way, at least no subclass is ever located above its
> superclass in the hierarchy -- as was the case with Lucy::Searcher subclassing
> Lucy::Search::Searchable. They're always at the same level or below.
Yes, this is a plus.
> Additionally, we remove the ambiguity about what the second part of the class
> name means -- it's always a grouping. Think of Lucy::Search as LucySearch and
> Lucy::Index as LucyIndex, if you like.
That sounds like a good way to view it. As long as it's consistent, I
could get used to it.
> Lucy::Object::Obj
> Lucy::Search::Searchable
> Lucy::Search::Searcher
> Lucy::Search::PolySearcher
Lucy::Object::Obj
Lucy::Search::Searcher
Lucy::Search::SimpleSearcher
Lucy::Search::PolySearcher
Could we agree that Lucy::Dir::SubClass should subclass
Lucy::Dir::Class? That in general the subclass should add a word in
front of the class it derives from? This wouldn't need to apply
across different Dir's, but it would help me visual better within a
given directory.
> Lucy::Object::Obj
> Lucy::Plan::FieldType
> Lucy::Plan::TextType
> Lucy::Plan::FullTextType
> Lucy::Plan::StringType
Working blindly but consistently:
Lucy::Object::Obj
Lucy::Plan::Type
Lucy::Plan::TextType
Lucy::Plan::FullTextType
Lucy::Plan::StringTextType
Thanks for dealing rationally with my silly quibbles. Overall your
scheme seems workable, and likely an improvement on the current state
of affairs.
--nate