B
Bob Aman
More nubyness. Apologies.
Ok, so, I have this rss feed caching system i'm working on. Ideally,
I'd like to have as little of the internal workings of the thing
visible as possible. I just want the programmer to interact with Feed
and FeedItem objects, not the caching mechanisms.
It seems to me that I don't really want the programmer to be able to
create instances of a FeedItem manually. All FeedItems ought to be
created automatically by a Feed object. But it seems like ruby lacks
the direct equivalent of c++'s "friend", so I guess I can't give
access to the "new" class method only to Feed.
Also, I'd like to make the caching mechanism be changable. It'd be
nice to be able to switch between, say, a database-based cache and a
file system-based cache. Perhaps like this:
FeedCache.cache_type =3D atabaseFeedCache
And then the Feed object would simply use the DatabaseFeedCache behind
the scenes. But again, I'm not sure how to make the cache's behavior
available only to the Feed and FeedItem classes (or even if I can).
--=20
Bob Aman
Ok, so, I have this rss feed caching system i'm working on. Ideally,
I'd like to have as little of the internal workings of the thing
visible as possible. I just want the programmer to interact with Feed
and FeedItem objects, not the caching mechanisms.
It seems to me that I don't really want the programmer to be able to
create instances of a FeedItem manually. All FeedItems ought to be
created automatically by a Feed object. But it seems like ruby lacks
the direct equivalent of c++'s "friend", so I guess I can't give
access to the "new" class method only to Feed.
Also, I'd like to make the caching mechanism be changable. It'd be
nice to be able to switch between, say, a database-based cache and a
file system-based cache. Perhaps like this:
FeedCache.cache_type =3D atabaseFeedCache
And then the Feed object would simply use the DatabaseFeedCache behind
the scenes. But again, I'm not sure how to make the cache's behavior
available only to the Feed and FeedItem classes (or even if I can).
--=20
Bob Aman