thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Slee <ms...@facebook.com>
Subject RE: specializing / polymorphic types?
Date Wed, 17 Jun 2009 21:57:43 GMT
There has been talk of creating a union type in Thrift which would probably most closely approximate
what you want here. It's not true polymorphism or type inheritance, and you'll probably still
end up with a switch()-block or equivalent somewhere, but it may help.

http://issues.apache.org/jira/browse/THRIFT-409


-----Original Message-----
From: Jonathan Ellis [mailto:jbellis@gmail.com] 
Sent: Friday, June 12, 2009 9:38 PM
To: thrift-user@incubator.apache.org
Subject: specializing / polymorphic types?

I'd like to define a struct filter_t such that i can define methods
get(string key, filter_t filter) and scan(string start_key, string
end_key, filter_t filter) and then specialize filter_t as
column_filter_t, time_filter_t, etc.

Right now we have a dozen get_ methods, which is bad enough as it is
but now we are facing a copy/paste to make scan versions of each.
Please tell me there is a better way.

-Jonathan

Mime
View raw message