Hi, I have a custom database join and can''t see how to map it with activerecord. Table "A" with a "request_type" column that can be 1 or 2. Table "B" that hold requests type 1 with custom fields Table "C" that hold requests type 2 with custom fields. The join between A and B or A and C depends in the value "request_type" column have in tabale A. Can I create activerecords objects that map this kind of relation ? I was looking how to do "aggregation" with activerecord but don''t found a solution either. -- :: Nelson ::
On 7/26/05, nelson <kascote-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > I have a custom database join and can''t see how to map it with activerecord. > Table "A" with a "request_type" column that can be 1 or 2. > Table "B" that hold requests type 1 with custom fields > Table "C" that hold requests type 2 with custom fields. > > The join between A and B or A and C depends in the value > "request_type" column have in tabale A. > Can I create activerecords objects that map this kind of relation ? > I was looking how to do "aggregation" with activerecord but don''t > found a solution either.How are you querying the joins at present? This doesn''t look particularly performant, it''s a pretty bad anti-pattern. I assume you have a pre existing schema that you''re working with and that you can''t make the change? -- Cheers Koz
hi koz (and others) -- I''ve read books that recommend several different approaches, viz.: * table A has a category column and a join column to tables B & C, or * table A has two fields joining to either B or C, or * table A joins to one table, BC, which incorporates all of B & C''s columns but leaves half of them blank depending on the data type). however, i''ve never found a clear rationale for preferring any one of these approaches. can you explain which approach is best from a design-patterns and data integrity perspective, and why? my preference, for now, is the second approach (adding one add''l field to table A), since in Rails you can simply test whether objectB or objectC is nil to determine the type of the reference, and very little data is duplicated. thank you, nick On 25-Jul-05, at 4:22 PM, Michael Koziarski wrote:> On 7/26/05, nelson <kascote-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Hi, >> I have a custom database join and can''t see how to map it with >> activerecord. >> Table "A" with a "request_type" column that can be 1 or 2. >> Table "B" that hold requests type 1 with custom fields >> Table "C" that hold requests type 2 with custom fields. >> >> The join between A and B or A and C depends in the value >> "request_type" column have in tabale A. >> Can I create activerecords objects that map this kind of relation ? >> I was looking how to do "aggregation" with activerecord but don''t >> found a solution either. >> > > How are you querying the joins at present? This doesn''t look > particularly performant, it''s a pretty bad anti-pattern. > > I assume you have a pre existing schema that you''re working with and > that you can''t make the change? > > -- > Cheers > > Koz > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Hey guys, Have you seen this AJAX site? http://www.backbase.com/ Cheers, Alessandro
On 7/26/05, Nick Ragaz <n.ragaz-H217xnMUJC0sA/PxXw9srA@public.gmane.org> wrote:> hi koz (and others) -- > > I''ve read books that recommend several different approaches, viz.: > > * table A has a category column and a join column to tables B & C, or > * table A has two fields joining to either B or C, or > * table A joins to one table, BC, which incorporates all of B & C''s > columns but leaves half of them blank depending on the data type).I''d go with this approach, but it depends on your requirements. The main benefit being, you can query the association in one hit SELECT a.blah, bc.blahb, bc.blahc from a left outer join bc on a.bc_id = bc.id Rather than n+1 selects> however, i''ve never found a clear rationale for preferring any one of > these approaches. can you explain which approach is best from a > design-patterns and data integrity perspective, and why?-- Cheers Koz
Pretty nice, but did you see how much they are charging?!? Production € 4,800 per CPU Testing & Acceptance € 2,400 per CPU Essential Technical Support € 2,000 per 5 request tickets Premium Technical Support € 12,000 per year Pretty outrageous if you ask me. On Jul 25, 2005, at 3:14 PM, Alessandro Cauduro wrote:> Hey guys, > > Have you seen this AJAX site? > > http://www.backbase.com/ > > Cheers, > Alessandro > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-Ezra Zygmuntowicz Yakima Herald-Republic WebMaster 509-577-7732 ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org
Interesting, but one of my first reactions is "Wow. It is pretty ballsy to use copyright/trademarked images on a site that is selling services." Check out the "Shop in a different way" demo to see a wealth of Dell images and dell-like products names. I understand this is just a demo of the capabilities, but I would put the usage in the "Very Bad Idea" pile. -Jeff Alessandro Cauduro wrote:>Hey guys, > >Have you seen this AJAX site? > >http://www.backbase.com/ > >Cheers, >Alessandro > >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > >
On 7/25/05, Jeff Casimir <jeff-+RlNNtFrnNmT15sufhRIGw@public.gmane.org> wrote:> Interesting, but one of my first reactions is "Wow. It is pretty ballsy > to use copyright/trademarked images on a site that is selling services." > Check out the "Shop in a different way" demo to see a wealth of Dell > images and dell-like products names. I understand this is just a demo > of the capabilities, but I would put the usage in the "Very Bad Idea" pile. > > -JeffIt also doesn''t support Safari. There is a message in red at the top of the home page that says this: Your web browser is not compatible with the primary Backbase site. Find out which browsers are supported: Compatible browsers. Clicking on the compatible browsers link yields this bit of wisdom: Support for Safari and Opera is forthcoming. If you want to upgrade your browser we recommend Firefox. I find that extremely funny for some reason. Melissa
This is a perfect example of overuse of Ajax. Yeah it looks pretty, but I couldn''t figure out in 5 seconds where to drop my shopping items. Ajax is best used to enhance UI to make things simpler, not make it look flashy and unusable. I''ll stick with Rails and Prototype/Scriptaculous. Yeah you can drag and drop things? So what? Remember Windows 3.1? I thought we already got over the overuse of drag & drop phase. Shane On 7/25/05, M. Bitner <moexu13-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 7/25/05, Jeff Casimir <jeff-+RlNNtFrnNmT15sufhRIGw@public.gmane.org> wrote: > > Interesting, but one of my first reactions is "Wow. It is pretty ballsy > > to use copyright/trademarked images on a site that is selling services." > > Check out the "Shop in a different way" demo to see a wealth of Dell > > images and dell-like products names. I understand this is just a demo > > of the capabilities, but I would put the usage in the "Very Bad Idea" pile. > > > > -Jeff > > It also doesn''t support Safari. There is a message in red at the top > of the home page that says this: > > Your web browser is not compatible with the primary Backbase site. > Find out which browsers are supported: Compatible browsers. > > Clicking on the compatible browsers link yields this bit of wisdom: > > Support for Safari and Opera is forthcoming. > If you want to upgrade your browser we recommend Firefox. > > I find that extremely funny for some reason. > > Melissa > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On 7/25/05, Michael Koziarski <koziarski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 7/26/05, Nick Ragaz <n.ragaz-H217xnMUJC0sA/PxXw9srA@public.gmane.org> wrote: > > hi koz (and others) -- > > > > I''ve read books that recommend several different approaches, viz.: > > > > * table A has a category column and a join column to tables B & C, or > > * table A has two fields joining to either B or C, or > > * table A joins to one table, BC, which incorporates all of B & C''s > > columns but leaves half of them blank depending on the data type). > > I''d go with this approach, but it depends on your requirements. > The main benefit being, you can query the association in one hit > > SELECT a.blah, bc.blahb, bc.blahc from a left outer join bc on a.bc_id = bc.id > > Rather than n+1 selects > > however, i''ve never found a clear rationale for preferring any one of > > these approaches. can you explain which approach is best from a > > design-patterns and data integrity perspective, and why? >The problem with that approach is that I have very diferent tables B and C and a lot of empty fields will be left. I''ll try Nick suggest for second option and use another field in table A to link the other table and then let RoR make your magic. thanks !! -- :: Nelson ::
And you can''t link to anything on the site. That''s no good. On 7/25/05, Shane Vitarana <shanev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> This is a perfect example of overuse of Ajax. Yeah it looks pretty, > but I couldn''t figure out in 5 seconds where to drop my shopping > items. Ajax is best used to enhance UI to make things simpler, not > make it look flashy and unusable. I''ll stick with Rails and > Prototype/Scriptaculous. Yeah you can drag and drop things? So what? > Remember Windows 3.1? I thought we already got over the overuse of > drag & drop phase. > > Shane > > On 7/25/05, M. Bitner <moexu13-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On 7/25/05, Jeff Casimir <jeff-+RlNNtFrnNmT15sufhRIGw@public.gmane.org> wrote: > > > Interesting, but one of my first reactions is "Wow. It is pretty ballsy > > > to use copyright/trademarked images on a site that is selling services." > > > Check out the "Shop in a different way" demo to see a wealth of Dell > > > images and dell-like products names. I understand this is just a demo > > > of the capabilities, but I would put the usage in the "Very Bad Idea" pile. > > > > > > -Jeff > > > > It also doesn''t support Safari. There is a message in red at the top > > of the home page that says this: > > > > Your web browser is not compatible with the primary Backbase site. > > Find out which browsers are supported: Compatible browsers. > > > > Clicking on the compatible browsers link yields this bit of wisdom: > > > > Support for Safari and Opera is forthcoming. > > If you want to upgrade your browser we recommend Firefox. > > > > I find that extremely funny for some reason. > > > > Melissa > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Chris Boone http://hypsometry.com/ : website edification http://uvlist.org/ : free classifieds for the Upper Valley
On 7/25/05, nelson <kascote-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 7/25/05, Michael Koziarski <koziarski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On 7/26/05, Nick Ragaz <n.ragaz-H217xnMUJC0sA/PxXw9srA@public.gmane.org> wrote: > > > hi koz (and others) -- > > > > > > I''ve read books that recommend several different approaches, viz.: > > > > > > * table A has a category column and a join column to tables B & C, or > > > * table A has two fields joining to either B or C, or > > > * table A joins to one table, BC, which incorporates all of B & C''s > > > columns but leaves half of them blank depending on the data type). > > > > I''d go with this approach, but it depends on your requirements. > > The main benefit being, you can query the association in one hit > > > > SELECT a.blah, bc.blahb, bc.blahc from a left outer join bc on a.bc_id = bc.id > > > > Rather than n+1 selects > > > however, i''ve never found a clear rationale for preferring any one of > > > these approaches. can you explain which approach is best from a > > > design-patterns and data integrity perspective, and why? > > > > The problem with that approach is that I have very diferent tables B > and C and a lot of empty fields will be left. > I''ll try Nick suggest for second option and use another field in table > A to link the other table and then let RoR make your magic. > > thanks !! > > -- > :: Nelson :: > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >But how is this any different than having a "master table", with one autogenerated ID field and a type-defining field, and separate tables for the different types? While STI (Single Table Inheritance) is an easy model to implement in Rails, if implemented properly in the RDBMS using normalized tables, instead of just one big fat table with the union of all the fields for the different types available (say you actually do need to have different tables for the different subclasses), is really no different than a UNION query to join everything together and an INSTEAD OF trigger to push data into the right subtables. I''d rather have an ''Entity'' table (id, entity_type fields), and subtables like ''Employees'', ''Customers'', etc., because it makes dealing with other entity attributes or associations like addresses, etc., easier. Otherwise, I might as well be using a flat file database/application, and the report developers are going to insist on buying me ouzo shots, just to see me suffer... Just my 2 mils worth.
+1 for Shane. Totally agree. It''s like the developers got super excited over ajax and put it just about everywhere they could fit it, without really thinking about where it would be useful and where it would not be. On 7/26/05, Chris Boone <hypsometry-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > And you can''t link to anything on the site. That''s no good. > > On 7/25/05, Shane Vitarana <shanev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > This is a perfect example of overuse of Ajax. Yeah it looks pretty, > > but I couldn''t figure out in 5 seconds where to drop my shopping > > items. Ajax is best used to enhance UI to make things simpler, not > > make it look flashy and unusable. I''ll stick with Rails and > > Prototype/Scriptaculous. Yeah you can drag and drop things? So what? > > Remember Windows 3.1? I thought we already got over the overuse of > > drag & drop phase. > > > > Shane > > > > On 7/25/05, M. Bitner <moexu13-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On 7/25/05, Jeff Casimir <jeff-+RlNNtFrnNmT15sufhRIGw@public.gmane.org> wrote: > > > > Interesting, but one of my first reactions is "Wow. It is pretty > ballsy > > > > to use copyright/trademarked images on a site that is selling > services." > > > > Check out the "Shop in a different way" demo to see a wealth of Dell > > > > images and dell-like products names. I understand this is just a > demo > > > > of the capabilities, but I would put the usage in the "Very Bad > Idea" pile. > > > > > > > > -Jeff > > > > > > It also doesn''t support Safari. There is a message in red at the top > > > of the home page that says this: > > > > > > Your web browser is not compatible with the primary Backbase site. > > > Find out which browsers are supported: Compatible browsers. > > > > > > Clicking on the compatible browsers link yields this bit of wisdom: > > > > > > Support for Safari and Opera is forthcoming. > > > If you want to upgrade your browser we recommend Firefox. > > > > > > I find that extremely funny for some reason. > > > > > > Melissa > > > _______________________________________________ > > > Rails mailing list > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > -- > Chris Boone > > http://hypsometry.com/ : website edification > http://uvlist.org/ : free classifieds for the Upper Valley > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Also, it says "Powerful XML-based User Interface language", which translates as "Throw away your existing knowledge of HTML, and learn our stuff" (which won''t work anywhere else). Good to have Rails. Anyway, I''d rather talk about how to make Rails even better on the mailing list than pointing out mistakes "the other guys" make-- but pointing out what to avoid is probably a good thing in itself. Thomas Am 26.07.2005 um 21:13 schrieb Jin Lee:> +1 for Shane. Totally agree. It''s like the developers got super > excited over ajax and put it just about everywhere they could fit > it, without really thinking about where it would be useful and > where it would not be. > > On 7/26/05, Chris Boone <hypsometry-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: And you can''t > link to anything on the site. That''s no good. > > On 7/25/05, Shane Vitarana <shanev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > This is a perfect example of overuse of Ajax. Yeah it looks pretty, > > but I couldn''t figure out in 5 seconds where to drop my shopping > > items. Ajax is best used to enhance UI to make things simpler, not > > make it look flashy and unusable. I''ll stick with Rails and > > Prototype/Scriptaculous. Yeah you can drag and drop things? So > what? > > Remember Windows 3.1? I thought we already got over the overuse of > > drag & drop phase. > > > > Shane > > > > On 7/25/05, M. Bitner < moexu13-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On 7/25/05, Jeff Casimir <jeff-+RlNNtFrnNmT15sufhRIGw@public.gmane.org> wrote: > > > > Interesting, but one of my first reactions is "Wow. It is > pretty ballsy > > > > to use copyright/trademarked images on a site that is selling > services." > > > > Check out the "Shop in a different way" demo to see a wealth > of Dell > > > > images and dell-like products names. I understand this is > just a demo > > > > of the capabilities, but I would put the usage in the "Very > Bad Idea" pile. > > > > > > > > -Jeff > > > > > > It also doesn''t support Safari. There is a message in red at > the top > > > of the home page that says this: > > > > > > Your web browser is not compatible with the primary Backbase site. > > > Find out which browsers are supported: Compatible browsers. > > > > > > Clicking on the compatible browsers link yields this bit of > wisdom: > > > > > > Support for Safari and Opera is forthcoming. > > > If you want to upgrade your browser we recommend Firefox. > > > > > > I find that extremely funny for some reason. > > > > > > Melissa > > > _______________________________________________ > > > Rails mailing list > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > -- > Chris Boone > > http://hypsometry.com/ : website edification > http://uvlist.org/ : free classifieds for the Upper Valley > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Guys, I sent the email indicating this website. My intention was to show what other kind of AJAX was being done, so that we could see if any of this could be useful to incorporate into Rails. Cheers, Alessandro -----Mensagem original----- De: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] Em nome de Thomas Fuchs Enviada em: terça-feira, 26 de julho de 2005 16:25 Para: Jin Lee; rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Assunto: Re: [Rails] More AJAX Also, it says "Powerful XML-based User Interface language", which translates as "Throw away your existing knowledge of HTML, and learn our stuff" (which won''t work anywhere else). Good to have Rails. Anyway, I''d rather talk about how to make Rails even better on the mailing list than pointing out mistakes "the other guys" make-- but pointing out what to avoid is probably a good thing in itself. Thomas Am 26.07.2005 um 21:13 schrieb Jin Lee:> +1 for Shane. Totally agree. It''s like the developers got super > excited over ajax and put it just about everywhere they could fit > it, without really thinking about where it would be useful and > where it would not be. > > On 7/26/05, Chris Boone <hypsometry-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: And you can''t > link to anything on the site. That''s no good. > > On 7/25/05, Shane Vitarana <shanev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > This is a perfect example of overuse of Ajax. Yeah it looks pretty, > > but I couldn''t figure out in 5 seconds where to drop my shopping > > items. Ajax is best used to enhance UI to make things simpler, not > > make it look flashy and unusable. I''ll stick with Rails and > > Prototype/Scriptaculous. Yeah you can drag and drop things? So > what? > > Remember Windows 3.1? I thought we already got over the overuse of > > drag & drop phase. > > > > Shane > > > > On 7/25/05, M. Bitner < moexu13-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On 7/25/05, Jeff Casimir <jeff-+RlNNtFrnNmT15sufhRIGw@public.gmane.org> wrote: > > > > Interesting, but one of my first reactions is "Wow. It is > pretty ballsy > > > > to use copyright/trademarked images on a site that is selling > services." > > > > Check out the "Shop in a different way" demo to see a wealth > of Dell > > > > images and dell-like products names. I understand this is > just a demo > > > > of the capabilities, but I would put the usage in the "Very > Bad Idea" pile. > > > > > > > > -Jeff > > > > > > It also doesn''t support Safari. There is a message in red at > the top > > > of the home page that says this: > > > > > > Your web browser is not compatible with the primary Backbase site. > > > Find out which browsers are supported: Compatible browsers. > > > > > > Clicking on the compatible browsers link yields this bit of > wisdom: > > > > > > Support for Safari and Opera is forthcoming. > > > If you want to upgrade your browser we recommend Firefox. > > > > > > I find that extremely funny for some reason. > > > > > > Melissa > > > _______________________________________________ > > > Rails mailing list > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > -- > Chris Boone > > http://hypsometry.com/ : website edification > http://uvlist.org/ : free classifieds for the Upper Valley > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.9.5/58 - Release Date: 25/7/2005
On Tue, 2005-07-26 at 10:16 -0700, Corey Lawson wrote:> But how is this any different than having a "master table", with one > autogenerated ID field and a type-defining field, and separate tables > for the different types? > > While STI (Single Table Inheritance) is an easy model to implement in > Rails, if implemented properly in the RDBMS using normalized tables, > instead of just one big fat table with the union of all the fields for > the different types available (say you actually do need to have > different tables for the different subclasses), is really no different > than a UNION query to join everything together and an INSTEAD OF > trigger to push data into the right subtables. > > I''d rather have an ''Entity'' table (id, entity_type fields), and > subtables like ''Employees'', ''Customers'', etc., because it makes > dealing with other entity attributes or associations like addresses, > etc., easier.But that is less flexible than a tab;e with types being a link from another table that enumerates them. Consider your example above, you code to todays spec. In 6 months, the company decides it wants to add another entity. In STI, you have to add another table and possibly change code so as to access the table. With the join table, adding the entity is as simple as adding the record to the join table. Barring complicated new views and controllers needing to be aware of specialties of the new entity, you are done. While more likely code still changes, it should be less code. Right now I am working with several such tables where there is a lot of user defined information. If I had to create a new table each time the customer wanted a new option, I would be in software maintenance hell. Right now we are architecting in the ability to handle most cases the user is likely to throw at us. Take for instance the drupal permissions, or at least the version of it I last had to deal with. You create roles for people, and for the role you specify what permissions you want the role to have. Then you assign the person to a roll. In STI, you would have a generic user class, and then you would create an admin, normal user, whatever else classes and pick the user out of the special class. Adding a new class would mean needing to add another table. I''ll admit my example of drupal leans heavily to using join tables, and is stretching to make STI usable. And all of this is just my opinion> Otherwise, I might as well be using a flat file database/application, > and the report developers are going to insist on buying me ouzo shots, > just to see me suffer...If your report developers can''t deal with the join, they should probably learn more about what it is they are working with. But again, it is opinion. -- Steven Critchfield <critch-wQLwMjUOumVBDgjK7y7TUQ@public.gmane.org>