I've had a look around but can't find any references for how to implement my own namespace handlers.
I have a gateway per orm entity based on an abstract gateway (similar to the one included with CS2, except each gateway only deals with a single entity) and I end up with a lot of repeated bean definitions like this. The factory looks for {path.to.entity}Gateway and if it finds it uses that, if not creates an instance of the abstract gateway.
<bean id="GWFactory" class="model.factory.GatewayFactory" />
<bean id="ContactGateway" factory-bean="GWFactory" factory-method="getGateway">
<constructor-arg name="entity" value="Contact" />
</bean>
<bean id="CustomerGateway" factory-bean="GWFactory" factory-method="getGateway">
<constructor-arg name="entity" value="Customer" />
</bean>
etc...
So what i was thinking was to create a custom namespace to allow me to write this in a more compact fashion, or even automate the process of creating a gateway bean for every entity.
<gw:config factory-class="model.factory.GatewayFactory" />
<gw:create id="ContactGateway" for="Contact" />
<gw:create id="CustomerGateway" for="Customer" />
Has anyone ever tried to implement a custom namespace, or have any pointers to get me started?
I'd be happy to contribute this back in the form of github repo and/or docs
Cheers, Chris