[Zope-dev] ZPatterns: General Design Question

Roch'e Compaan roche@ybm.co.za
Thu, 14 Dec 2000 14:42:44 +0200


As part of a Customer Relationship Management system our company is
developing, we have a Licenses specialist which manages product licenses.
All license objects do not have the same attributes however.  The various
attributes relating to different licence types are not known attributes from
the outset.

My idea is to have a LicenseType class for which the user can define extra
attributes per instance eg:
	LicenseType1 with properties A,B,C
	LicenseType2 with properties D,E,F

When new licenses are created the user first selects a LicenseType.  Based
on this selection the properties of the selected LicenseType are added to a
specific License instance.

As I see it one can take two approaches to this:
a) either add a single dictionary property for both license and licensetypes
which holds user defined attributes
	or
b) explicityly call manage_addProperty per instance to add properties.

Any ideas?

Roché