Announcement Announcement Module
Collapse
No announcement yet.
command pattern the easy way Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • command pattern the easy way

    Please suggest the most harmonious way for me to implement a command pattern in spring.

    I want my tests/gui's to create a command. This could be on another machine, or not. Then I want the command to be instantiated on a server and receive the "execute()" command. This command may need to hae access to SpringManaged resources.

    If I define the command as a Spring managed bean and have it list its dependencies then if those are not available on the client (Say the web tier with no access to the services) then that is problematic.

    Please either advice of an approach, or better yet point me to an existing framework that has addressed these issues.

    Thanks, and please forgive my beginning Spring knowledge.

    -Bruce

  • #2
    You could have a look at this topic:

    http://forum.springframework.org/showthread.php?t=18083

    Here the strategy is explained, but the command and the strategy aren`t that different.

    And to answer your question about access: well.. in some cases you need to access the applicationcontext and retrieve beans from it. You can retrieve the application context from the Servlet context (Spring places it there when the application context is loaded).
    Last edited by robyn; May 14th, 2006, 07:20 PM.

    Comment


    • #3
      No idea will this be too late (As I only started using spring pass few months), I posted two article on how to deliver command design pattern using Spring base on "Head First Design Patterns" example. Do check it out from my blog at
      http://coolboykl.blogspot.com, cheers

      Comment


      • #4
        Originally posted by Bruce Gordon View Post
        Please suggest the most harmonious way for me to implement a command pattern in spring.

        I want my tests/gui's to create a command. This could be on another machine, or not. Then I want the command to be instantiated on a server and receive the "execute()" command. This command may need to hae access to SpringManaged resources.

        If I define the command as a Spring managed bean and have it list its dependencies then if those are not available on the client (Say the web tier with no access to the services) then that is problematic.

        Please either advice of an approach, or better yet point me to an existing framework that has addressed these issues.

        Thanks, and please forgive my beginning Spring knowledge.

        -Bruce
        Controllers and handlers in spring MVC are built on top of command pattern.

        Comment

        Working...
        X