I've been working on creating a set of services that will be reused in a
variety of situations. What I really what is a way to bundle the schema,
contribution, and service construction stuff all together as a reusable
unit.

Here is what I had in mind is creating a template that includes
configuration point definitions, schema definitions, and a service-point
definition, all bound together. I think that ServiceImplementationFactories
get the latitude of defining a schema, but BuilderFactory, or
create-instance is enough for most of my purposes.

<template id="MyTemplate" interface="MyInterface">
    <schema>
        <element name="datum">
            <attribute name="key" required="true" />
            <attribute name="value" required="true" />
            <rules>
                <read-attribute attribute="key" property="keyData" />
                <read-attribute attribute="value" property="valueData" />
            </rules>
        </element>
    </schema>
    <implementation>
        <create-instance class="impl.MyServiceImpl" />
    </implementation>
</template>

<service-point id="MyService" template-id="MyTemplate">
    <dataum key="joe" value="fred" />
</service-point>

<service-point id="MyOtherService" template-id="MyTemplate">
    <dataum key="mary" value="jane" />
</service-point>

The equivalent Hivemind configuration currently seems to be something like
the following, and the service
has to tear apart the configuration contribution.

<schema id="Simple">
    <element name="datum">
        <attribute name="key" required="true" />
        <attribute name="value" required="true" />
        <rules>
            <read-attribute attribute="key" property="keyData" />
            <read-attribute attribute="value" property="valueData" />
        </rules>
    </element>
</schema>

<configuration-point id="MyService" schema-id="Simple" />

<contribution configuration-id="MyService">
    <dataum key="joe" value="fred" />
</contribution>

<service-point id="MyService" interface="MyInterface">
    <invoke-factory>
        <construct class="impl.MyServiceImpl">
            <configuration>MyService</configuration>
        </construct>
    </invoke-factory>
</service-point>

<configuration-point id="MyOtherService" schema-id="Simple" />

<contribution configuration-id="MyOtherService">
    <dataum key="mary" value="jane" />
</contribution>

<service-point id="MyOtherService" interface="MyInterface">
    <invoke-factory>
        <construct class="impl.MyServiceImpl">
            <configuration>MyOtherService</configuration>
        </construct>
    </invoke-factory>
</service-point>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to