1. #1
    Ext JS Premium Member
    Join Date
    Aug 2009
    Posts
    112
    Vote Rating
    1
    Whatty is on a distinguished road

      0  

    Default ExtDirect and Spring.Net framework integration

    ExtDirect and Spring.Net framework integration


    Good morning,

    Has anyone integrated ExtJS and the Ext.Direct framework successfully.

    I am looking for strategies and how-to's on how to appropriately integrate these two frameworks, specifically bean life-cycle management how to properly connect the context to the Ext.Direct framework.

    Thanks in advance.

    Whatty

  2. #2
    Ext JS Premium Member
    Join Date
    Aug 2009
    Posts
    112
    Vote Rating
    1
    Whatty is on a distinguished road

      0  

    Default


    Good morning,

    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.

    Code:
            DirectProvider
    
            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);
            }
    specifically the last line that creates a new instance of the action classes and invokes the method on it.

    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.

    Whatty