Yes, I'm serious.
I've been back and forth on this, but have now decided - now that we're OO, it is STUPID for us to force ourselves to use massive, global caches (like VersioncontrolOperationCache) to do _all_ of our loading of any individual op item. Stupid because it forces us to constantly translate back and forth between the super-generic api module and any richness we could write into a specific backend. Stupid because big caches like that are useful for when you're doing massive listing queries, not for doing individualized operations. And given that, within any particular request cycle, there's almost guaranteed to be zero overlap between individual-repo-targeted operations and a listing operation, we get _zero_ out of using the static cache. And it makes our code, and OO hierarchy, utterly ass-backwards to do it this way. So no more. We can retain the big caches/loaders for when we're ACTUALLY doing listings, but otherwise, we're going to be building stacked object hierarchies from the VersioncontrolRepository object on down. So, the VersioncontrolRepository object will have things like a ::getBranches() method, and branches will have a ::getCommits() method...etc. The concepts won't be totally generic across all the backends, especially with centralized vs. distributed, but as long as the underlying datastructure is the same, then it doesn't matter if the interfaces between the backends diverge somewhat.
I'm going to be putting in the first few patches to illustrate the kind of approach I'm talking about, but this is a seriously important step to being able to build a rich system with vcapi, and we really need it for phase 2. After I've got the first few in, hopefully others can hop on and follow suit.
Comments
Comment #1
sdboyer commentedOK, I was overreacting a bit, as some of these methods are already there. But they're just a start :) We need more sanity...
Note that I don't mean this as a criticism towards you, marvil07 - rather, I see it as the next logical (and necessary) step in OOification. I don't think this need was anticipate-able at the outset.
Comment #2
sdboyer commentedLol. OK, the more I reflect on this, the more I realize I shouldn't post in frustration. I still think we need to really invert how some of this logic works, but it's not so
The entities system is basically what we're modelling here. Problem is, we're just doing it really badly. So in the short term (i.e., for D6), I'm gonna advocate that we do more straight loads and don't worry too much about the caching, at least for the individual operations. We can retain the big cacher for multiple operations. Then, when we port to D7, we can move over to using entities properly, and it'll be a whole lot less headache.
That seems to be the most time-efficient approach to me, anyway.
Comment #3
sdboyer commentedOK, we are going this route, but this issue is just stupid. Closing it and opening another.