I am trying to integrate the Spring.NET framework, which is a IOC / DI container that manages all the instance of my objects with the Ext.Direct framework.
I have investigated the code that execute the direct requests and have narrowed it down to the following code.
specifically the last line that creates a new instance of the action classes and invokes the method on it.
internal object Execute(DirectRequest request)
DirectAction action = this.actions[request.Action];
if (action == null)
throw new DirectException("Unable to find action, " + request.Action);
DirectMethod method = action.GetMethod(request.Method);
if (method == null)
throw new DirectException("Unable to find action, " + request.Method);
Type type = action.Type;
return method.Method.Invoke(type.Assembly.CreateInstance(type.FullName), request.Data);
As far as I can tell this is the most appropriate location for the integration point with the Spring.NET framework, where I would look up my Spring context and execute the method on the Spring managed bean instead of calling the CreateInstance method
Can anyone tell me if this is the correct approach or if there is a better solution for this.
Once I get this working I plan submitting this back to the community so I would like to get this correct so anyone else using the Spring.NET framework has a leg-up on this integration.
In fact, based on what I am currently seeing, there probably is a nice pattern that I can apply here to disconnect the object creation / lookup from the method execution that would allow multiple framework integrations instead of a hard-coded CreateInstance method, but am looking for advice from the individuals who wrote the Ext.Direct DotNET integration framework.
Thanks in advance.