Page 1 of 1

Best way to extend Able objects, like product, webpage

Posted: Wed Feb 04, 2009 12:19 pm
by jmestep
I'm working on a project where we are using Able objects, like a webpage, but adding additional information fields into a new table and creating the functionality to link webpages to webpages, etc. and display as links on a particular webpage- like related products. I've got that working fine with the additional fields being edited, deleted, saved along with the normal webpage fields. I've got the linking working fine by putting ids and types into a new table and then taking the particular id and type and turning it into a catalog node so that I can have access to the URL and name, etc. Part of that display code is:
foreach (W2MRelatedObject relatedObject in relatedObjects)
{
objectId2 = relatedObject.ObjectId2;
CatalogNode node = new CatalogNode(0, objectId2, 2);
where objectId2 is the id of the child object and 2 is the Able type for webpage.

I'm working on the admin pages now using EditSimilarProducts as a pattern. My linked objects show up fine only they are displayed using only the objectId2 since I haven't turned them into CatalogNodes to get the name. On section above, instead of searching for products, I'm filtering for webpages in a particular category, then those can be selected to link to the parent.
Would it be better to do some coding in my custom class to extend my objects to include the necessary data, like CatalogNode name, navigateURL? I worked on that some, but I was hesitant to use inheritance because of cautions I had read. One other book suggested using containment. Is there a best way to do this to not interfere with Able code and data access classes?
Thanks