Well, you don't necessarily need to replicate the database behavior in your object model. What about this:
public class Manufacturer
{
private int _id;
private string _name;
private List<Category> _categories;
}
public class Category
{
private int _id;
private string description;
private List<Manufacturer> _manufacturers;
}
This gives each class a generics list of the other, allowing you to do stuff like:
myGridView.DataSource = myCategory.Manufacturers;
or
myManufacturer.Categories.Add(new Category());
This brings some other interesting issues about loading data. E.g. when you load a Manufacturer, do you load all Categories? Probably not, because it means you load all categories, in turn loading all the associated manufacturers for the category, in turn loading all the categories and so on.
For this scenario, you may want to use a concept called lazy loading where you defer loading the data until you actually access it.
With regards to your ManufacturerCategory class: the rules of normalization that apply to databases do not apply to object models. That is, it's OK to have duplicate data in your object model, as long as you don't store it in duplicate fields / tables in the database. With an object model, it's important to normalize behavior, not the underlying data.
Hope this gives you some ideas.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of
ASP.NET 2.0 Instant Results and
Beginning Dreamweaver MX / MX 2004