Skip to Content
0
Sep 22, 2008 at 04:36 PM

Classes and Subclasses or alternative.

148 Views

Hi all,

I have the following 'issue': I want to create / update / retrieve BP relationships. My idea is to create a superclass with all general data for a relationship like Partner 1 & 2, type of relationship (employer-employee, husband-wife etc.). So far so good, but now it comes. All relationships have different attributes (created in CRM with Easy Enhancement Workbench, comparable to customer includes).

Does it make sense to create a subclass per relationship type, because based on that different logic has to be processed. Or put all these attributes, whether they belong to relationship type A, or B, in the same superclass?

Normally I would say the second option is better / more logical and put them all in ONE (super)class, but since every relationship is a specialization of the superclass due to all the different attributes, it would also make sense to create a new subclass for every relationship type. I actually want to avoid, using IF statement within the class (IF relationship A, ELSEIF relationship B, etc.), because when creating a new relationship type, I would have to change the superclass over and over again.

Thanks,

Micky.