The search seems to be down at this moment, and I''m curious whether CLSTI is possible in Rails. I can''t seem to find any info via google save a post to the list a couple months ago and a ton of references to STI. Before I receive the usual "Use (X) instead!" replies, I''ll say that I can''t change the db design for many reasons. Is CLSTI possible for a nice, normalized db in Rails? If so, do select queries use clean joins or lots of trips to the db? Any leads to docs?
CLSTI comes up every couple of months. There is even a patch on the trac which implements it to some degree ( its a old patch, it needs work for sure ). There where many 50+ posts threads about the outrage that CLSTI is not implemented in rails and the last word was that whoever needs it next should please implement it. This is standard rails policy, code which gets into rails needs to be in production use somewhere first. This might be a good opportunity to get it implemented included... On 8/8/05, Toby Boudreaux <rails-lb8SQxIZKShBDgjK7y7TUQ@public.gmane.org> wrote:> The search seems to be down at this moment, and I''m curious whether > CLSTI is possible in Rails. > I can''t seem to find any info via google save a post to the list a > couple months ago and a ton of references to STI. > > Before I receive the usual "Use (X) instead!" replies, I''ll say that > I can''t change the db design for many reasons. Is CLSTI possible for > a nice, normalized db in Rails? > > If so, do select queries use clean joins or lots of trips to the db? > > Any leads to docs? > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Tobi http://www.snowdevil.ca - Snowboards that don''t suck http://typo.leetsoft.com - Open source weblog engine http://blog.leetsoft.com - Technical weblog
Ah, nice. Well, I won''t be able to use Rails for the project in question, but I''ll certainly search Trac for the old patch and see if it might be something I can tweak a little bit in hopes of getting it implemented. Out of curiosity -- is there a list (perhaps on the wiki?) of major things that are not yet implemented in Rails? I''m not talking about crazy fringe stuff, but common patterns, etc, that can''t currently be used with the framework as-is? I''m sure it might be considered bad for the hype to have a single list of things for which Rails can''t be used, but it might be better than the type of outrage and possible backlash that might result from someone selling the framework based on hype then realizing it lacks (or prohibits in some way) certain things. On Aug 8, 2005, at 10:03 AM, Tobias Luetke wrote:> CLSTI comes up every couple of months. There is even a patch on the > trac which implements it to some degree ( its a old patch, it needs > work for sure ). > There where many 50+ posts threads about the outrage that CLSTI is not > implemented in rails and the last word was that whoever needs it next > should please implement it. This is standard rails policy, code which > gets into rails needs to be in production use somewhere first. > > This might be a good opportunity to get it implemented included... > > On 8/8/05, Toby Boudreaux <rails-lb8SQxIZKShBDgjK7y7TUQ@public.gmane.org> wrote: > >> The search seems to be down at this moment, and I''m curious whether >> CLSTI is possible in Rails. >> I can''t seem to find any info via google save a post to the list a >> couple months ago and a ton of references to STI. >> >> Before I receive the usual "Use (X) instead!" replies, I''ll say that >> I can''t change the db design for many reasons. Is CLSTI possible for >> a nice, normalized db in Rails? >> >> If so, do select queries use clean joins or lots of trips to the db? >> >> Any leads to docs? >> >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> > > > -- > Tobi > http://www.snowdevil.ca - Snowboards that don''t suck > http://typo.leetsoft.com - Open source weblog engine > http://blog.leetsoft.com - Technical weblog > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Hum, random question: why is it called Class Table Inheritance? That name seems so... non-descriptive to me. Since it''s the complement to Single Table Inheritance, why not call it "Multiple Table Inheritance" or better yet "Cascaded Table Inheritance"? Tobias Luetke wrote:> CLSTI comes up every couple of months. There is even a patch on the > trac which implements it to some degree ( its a old patch, it needs > work for sure ). > There where many 50+ posts threads about the outrage that CLSTI is not > implemented in rails and the last word was that whoever needs it next > should please implement it. This is standard rails policy, code which > gets into rails needs to be in production use somewhere first. > > This might be a good opportunity to get it implemented included...
I think it''s because the name implies that you are mapping classes and subclasses. Sometimes a table won''t have subs, but since this pattern isn''t so much per-table as per-database or per-namespace, and because it''s an ORM pattern, it nods towards the approach of creating subclasses (well, the closest thing you get) in your database. On Aug 8, 2005, at 2:25 PM, Daniel DeLorme wrote:> Hum, random question: why is it called Class Table Inheritance? > That name seems so... non-descriptive to me. Since it''s the > complement to Single Table Inheritance, why not call it "Multiple > Table Inheritance" or better yet "Cascaded Table Inheritance"? > > > Tobias Luetke wrote: > >> CLSTI comes up every couple of months. There is even a patch on the >> trac which implements it to some degree ( its a old patch, it needs >> work for sure ). >> There where many 50+ posts threads about the outrage that CLSTI is >> not >> implemented in rails and the last word was that whoever needs it next >> should please implement it. This is standard rails policy, code which >> gets into rails needs to be in production use somewhere first. >> This might be a good opportunity to get it implemented included... >> > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On 8/8/05, Daniel DeLorme <dan-ml-/iZ8BFr9PJYAvxtiuMwx3w@public.gmane.org> wrote:> Hum, random question: why is it called Class Table Inheritance? That > name seems so... non-descriptive to me. Since it''s the complement to > Single Table Inheritance, why not call it "Multiple Table Inheritance" > or better yet "Cascaded Table Inheritance"?Single Table Inheritance = One table holds data for all instances of all leaf classes derived from the same base class Concrete Table Inheritance = All instance data is contained in a specific table for each class, even if the class is derived from a base class with the same attributes (some column definitions are identical across several tables) Class Table Inheritance = Sublcasses each have their own tables, but attributes that are inherited have the instance data stored in the table for the parent (or other ancestor) class. I couldn''t tell you _exactly_ why those names were chosen, but they weren''t invented by DHH. They are part of the collection of Patterns of Enterprise Application Architecture: * http://martinfowler.com/eaaCatalog/singleTableInheritance.html * http://martinfowler.com/eaaCatalog/concreteTableInheritance.html * http://martinfowler.com/eaaCatalog/classTableInheritance.html -- Regards, John Wilger ----------- Alice came to a fork in the road. "Which road do I take?" she asked. "Where do you want to go?" responded the Cheshire cat. "I don''t know," Alice answered. "Then," said the cat, "it doesn''t matter." - Lewis Carrol, Alice in Wonderland