Niklas, I've answered that question from my previous employer and what I did was to basically reuse the form because it was used everywhere in the application. The persistent evil of copy and pasting whoever coded it possessed him because he replicated the same form 17 times. Which means the form was used at 17 different places.
I pulled my hair and started designing only 1 form for the entire 17 different places. I coded it and it worked. I've used a Facade Design Pattern that basically implements an interface where it knows what actions are associated with the form of interest. It knows how to pass the parameters to the right Action class. Your mapping forward can go to a different action common to all that can control the behavior of your form page. From you struts.config.xml file you can specify all those different actions to go to this one action that takes care of initializing/setting/routing your form of interest. Hope that gives you some details to start with. Rommel ________________________________ From: Niklas Johansson <nic_s...@hotmail.com> To: user@struts.apache.org Sent: Monday, April 13, 2009 2:12:17 PM Subject: Designing application using Struts Hello, I got some design questions when using Struts. If this is not the right place to post this kind of questions please let me know and I can create a QuickTopic. I am creating an application that contains several forms. Two of the forms belongs to two different parts which can be considered seperate applications (e.g. one is kind of an incident application). My plan is that I shall create these applications later as stand-alone applications. I am thinking about how to best put this code together. Here is my thoughts: Some high level requirements: R1. I want to make it easy to use the forms at different place in the application. R2. I want to make it easy to apply changes anywhere in the application as the application evolves. Thoughs about the design: D1. Creat my own UI components for each form. D2. Use parameterised Factory pattern for chosing which form to use. The actual tag, or all of them, for the chosen form should be returned in this case. Is this a good way of doing it or are there better ways of doing it? Any suggestions is most appreciated since I am totally new with Struts and I am trying to learn the nature of using it. Thank you in advance! Best Regards, Niklas _________________________________________________________________ News, entertainment and everything you care about at Live.com. Get it now! http://www.live.com/getstarted.aspx --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org