Loading ...
Sorry, an error occurred while loading the content.
 

Re: [XP] agile struts

Expand Messages
  • Paul Beckford
    ... Hi, I ve worked with struts using pico-container. Basically each action becomes a component that has it s service (domain) dependency injected. Worked
    Message 1 of 5 , Jan 2, 2006
      Manlio Malaidini wrote:

      >Hello.
      >
      >I hope this is not too OT. I'm starting a new project and I need to work on
      >an existing code base. The project consists of an enterprise webapp based on
      >Struts.
      >
      >This is the first time that I work on Struts for serious stuff. Would it be
      >just me, I'd never choose Struts, I'd rather prefer some lighter frameworks.
      >Nevertheless, now I need to deal with it and at the least for some time I
      >cannot influence this choice. Maybe this can be an opportunity to learn that
      >it's not so bad anyway. I have some prejudices, but I'm ready to revise
      >them.
      >
      >I have already participated in webapp projects done the XP way (whatever it
      >means). For example, I'm used to concepts like isolating the domain from the
      >container. What I'd like to hear from you is some inspiration about the best
      >way to use Struts in an agile way. I'm thinking about best practices in
      >order to minimize time waisted in maintaining configuration scripts, or
      >which taglibs keep your code flow clear and refactorable or .......
      >
      >As you can see I'm pretty scared by the beast.
      >Many thanks
      >MM
      >
      >
      >
      Hi,

      I've worked with struts using pico-container. Basically each action
      becomes a component that has it's service (domain) dependency injected.
      Worked quite well. To do this I think we replaced the request processor
      in struts with one that integrates with pico-container. I can't remember
      the details, as most of the low level plumbing was performed by a
      consultant from ThoughtWorks. Perhaps if you look on the ThoughtWorks
      website they may provide an example.

      Once we had de-coupled the StrutsActions in this way we used JMock to
      mock dependencies, and wrote the action code using JUnit and TDD. From
      what I remember we had to leave things like the testing of struts
      validations to the acceptance tests. For acceptance testing WATIR works
      well for any webapp on IE. Some people prefer using FIT which also has
      extensions for web applications.

      BTW I've heard that Struts will be joining with Webwork. Webwork has IoC
      built in. There may be guidelines on how to migrate old struts to the
      new Struts/Webwork. That may be a good place to start.

      Paul.

      >[Non-text portions of this message have been removed]
      >
      >
      >
      >To Post a message, send it to: extremeprogramming@...
      >
      >To Unsubscribe, send a blank message to: extremeprogramming-unsubscribe@...
      >
      >ad-free courtesy of objectmentor.com
      >Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
      >
      >
    • Jeff Grigg
      ... Good advice. Personally, I would highly recommend The Spring Framework over pico container. I think it s stronger, more popular, and better supported.
      Message 2 of 5 , Jan 2, 2006
        > --- Manlio Malaidini wrote:
        >> [...] I'm starting a new project and I need to work on
        >> an existing code base. The project consists of an
        >> enterprise webapp based on Struts.

        --- Paul Beckford <beckfordp@b...> wrote:
        > I've worked with struts using pico-container. Basically
        > each action becomes a component that has it's service
        > (domain) dependency injected. [...]

        Good advice. Personally, I would highly recommend The Spring
        Framework over pico container. I think it's stronger, more popular,
        and better supported. But the overall approach will be the same
        with either.

        See:
        http://www.springframework.org/

        But first I would focus on introducing automated tests, and
        refactoring. Introducing a dependency injection framework, like
        Spring or pico will help, but that's not the main objective.
      • Manlio Malaidini
        ... Really interesting. Which kind of result have you gained that was impossible or difficult without an IoC container? I can t remember ... I ve tried, but
        Message 3 of 5 , Jan 3, 2006
          On 1/2/06, Paul Beckford <beckfordp@...> wrote:
          >
          > I've worked with struts using pico-container. Basically each action
          > becomes a component that has it's service (domain) dependency injected.
          > Worked quite well. To do this I think we replaced the request processor
          > in struts with one that integrates with pico-container.


          Really interesting. Which kind of result have you gained that was impossible
          or difficult without an IoC container?

          I can't remember
          > the details, as most of the low level plumbing was performed by a
          > consultant from ThoughtWorks. Perhaps if you look on the ThoughtWorks
          > website they may provide an example.


          I've tried, but I've found nothing. If somebody from TW may share some
          insight it would be great.

          Once we had de-coupled the StrutsActions in this way we used JMock to
          > mock dependencies, and wrote the action code using JUnit and TDD. From
          > what I remember we had to leave things like the testing of struts
          > validations to the acceptance tests. For acceptance testing WATIR works
          > well for any webapp on IE. Some people prefer using FIT which also has
          > extensions for web applications.


          Yes, I understand, I would go with WATIR in my case.

          BTW I've heard that Struts will be joining with Webwork. Webwork has IoC
          > built in. There may be guidelines on how to migrate old struts to the
          > new Struts/Webwork. That may be a good place to start.


          I don't know Webwork, I'll take a look.
          Thanks a lot.
          MM


          [Non-text portions of this message have been removed]
        • Manlio Malaidini
          ... Thanks. The web is full with info about integration between Spring and
          Message 4 of 5 , Jan 3, 2006
            On 1/2/06, Jeff Grigg <jeffgrigg@...> wrote:
            >
            > Good advice. Personally, I would highly recommend The Spring
            > Framework over pico container. I think it's stronger, more popular,
            > and better supported. But the overall approach will be the same
            > with either.


            Thanks. The web is full with info about integration between Spring and
            Struts<http://www.google.com/search?sourceid=navclient-ff&ie=UTF-8&rls=GGGL,GGGL:2005-09,GGGL:en&q=struts+spring+integration>:
            in your experience where may I look specifically for succinct but useful
            info about the integration?

            But first I would focus on introducing automated tests, and
            > refactoring. Introducing a dependency injection framework, like
            > Spring or pico will help, but that's not the main objective.


            I haven't put my hands on sources yet, but as far as I know there should be
            already some sort of tests at unit and integration level.

            Thanks a lot
            MM


            [Non-text portions of this message have been removed]
          Your message has been successfully submitted and would be delivered to recipients shortly.