Nico Klasens schreef:
Considering these differences it might be wise to drop the usage of "mixin type" as name.
I agree. When I read this scetion my intial idea was not that this was a "mixin' type, but a "mimic' type: You map an objecttype (or functionset, or whatever) to make it appear as something else (namely a pre-defined objecttype, funtionset, etc)

I think it would not be too hard to make a few adjustements that would make 'mimicing' types possible. (The following is maybe a bit too detailed - it is just brainstorming though.) I.e. a builder main tag could include a "mimic' attribute that allows you to map the builder to a mimic type.
I.e:
 <builder name="mymail" extends="object" mimic="email">...
An alternate approach is to add a extra mimic tag, whcih could, besides the mimictype name, supply a class that allows one to supply information that is not stored in the mimicing builder (possibly including functions specific to a amimictype). It also allows a builder to mimic more than one type, if appropriate.
I,e,:
<mimic id="email" class="org.mmbase.component.email.MyEmailMimicType" />.

Fields can be extended in the same way:
 <field name="to" mimics="email:to_address">...
Or with a mimic-tag specific for field (with a optional class that allows for conversion of values for one type to another, if needed). (note: normally we use the name tag in the db tag to assign a name, but that is a bit silly - maybe we should change that?)
Gomez
_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers

Reply via email to