Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Pet Shop Application II

Sam Gentile quoted my post about the Pet Shop application with a title that is a little unfair to the MSDN guys that just copied the Sun's J2EE database structure ;)

One of the most interesting issues in PetShop's database design is that there are several tables with the same primary key. Even if there could be some cases where you want to do that, that's usually a bad design, and it's probably caused by the naive mapping between objects and database tables that OO programmers usually do, which is mapping each class to a table.

EJB applications usually have a table for each Entity Bean, and as they had several entity beans that model parts of the 'User', they ended with 3 tables with the UserId as a primary key.

By the way, the article is now on HTML.

No Comments