Which pattern fits best?

Discussions

EJB design: Which pattern fits best?

  1. Which pattern fits best? (1 messages)

    i have a n application in which single servlet is going to be accessed by no. of JSP pages.So in order to minimize the maintainence risk and other issues whiach pattern can i use?
    as i am new to this j2ee can you please give me the proper guidence?

    vijay.

    Threaded Messages (1)

  2. Which pattern fits best?[ Go to top ]

    Hi there,

    I am not sure what or any specific pattern you could use. May be you could introduce Struts like action in your servlet.

    for example : Servlet

    .... doPost(request, response) ....
    {
        Action action = request.getAction().execute();
        action.next();
    }

    By doing this u might not touch u r servlet anymore. all u r actions are abstracted in u r specific action classes.

    I am not sure this would help. but just a thought


    /* example action - something like this. u could modify or make it more valuable */

    Class UserValidateAction implements Action
    {
    ActionDO actionDO = null;
    public UserValidateAction(ActionDO ADO)
    {
    this.actionDO = ADO
    }

    public void execute()
    {
      //do something using the values from DO
    }

    public next()
    {
      //where to go after this action.
    }


    }
    }


    Note :- Action is already in java so use some other name ....

    -arun