Announcement Announcement Module
Collapse
No announcement yet.
Exposing multiple service beans for Flex Remoting Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exposing multiple service beans for Flex Remoting

    I am very pleased to see the SBI project introduced to the suite of Spring projects. I have been working with Flex for 5 years since Flex 1.5 and using Spring with Flex for about as long.

    Most of the integration was using Jeff Vroom's SpringFactory class to bridge the communication gap between Flex and Spring using RemoteObjects. This new project is refreshing to say the least.

    Here is a thought. Currently you expose beans in your ApplicationContext similar to this:

    Code:
    <!-- START Expose the service beans for BlazeDS remoting -->
        <bean id="clientService" class="org.springframework.flex.messaging.remoting.FlexRemotingServiceExporter">
            <property name="messageBroker" ref="mySpringManagedMessageBroker"/>
            <property name="service" ref="clientServiceBean"/>
        </bean>
    
        <bean id="projectService" class="org.springframework.flex.messaging.remoting.FlexRemotingServiceExporter">
            <property name="messageBroker" ref="mySpringManagedMessageBroker"/>
            <property name="service" ref="projectServiceBean"/>
        </bean>
    What I had to do is create a FlexRemotingServiceExporter bean for each Spring service bean in my project. Is there any throughts to creating a single point similar to defining Hibernate AnnotationSessionFactoryBean instances? Maybe something like this:

    Code:
    <bean id="springFactoryService" class="org.springframework.flex.messaging.remoting.FlexRemotingServiceExporter">
            <property name="messageBroker" ref="mySpringManagedMessageBroker"/>
            <property name="service" ref="clientServiceBean"/>
            <property name="service" ref="projectServiceBean"/>
            // Other service beans
    </bean>
    Basically you have moved the remoting-config destinations to the ApplicationContext.xml config file in its current state, which is great. Something like this could clean up the config a little more and simplify the Flex client RemoteObject definitions. I use Cairngorm for all enterprise Flex apps, I could see something like this cleaning up some config for it as well.

    Anyhow, this looks like a great first step and was trivial to set up. Nice work!
Working...
X