Hi,

First let me thank you all for lots of mails, which
helped to take few decisions in building the
framework.

I did like few of the approaches.

Some clearly defines the independence of all three
components model, view, controller. Especially I am
impressed with the way you map the business object
name with the action name.

But let me tell you, I would like to make it very
simple, by using xml file as a property file. This xml
file will be mapping the action name to the business
class name. Or even an ordinary .properties file will
do.

But I am not too sure of your approach of having a .do
class and other stuff. Otherwise, I am very happy
because, i am not going to have tight coupling between
model and controller.

Thank you for all your guidance.

Manisha
--- "Craig R. McClanahan"
<[EMAIL PROTECTED]> wrote:
> Manisha Menon wrote:
>
> > Thank you craig.
> >
> > I am definitely looking at the struts framework
> today.
> > But can you please enlighten me about the action
> > dispatcher in the framework.
> >
>
> In Struts (as in many other people's MVC-type
> frameworks discussed on
> this mailing
> list over the last year or so), the controller
> servlet uses the request
> URI to
> choose what "action" needs to take place.  My
> favorite way to do this is
> mapping
> the servlet to the "*.do" extension, so you might
> have a form submit to
> a URL like
> "saveCustomer.do" -- the "do" implying "go do
> something".  Note that the
> JSP page
> itself has no notion of what piece of business logic
> is going to respond
> to this
> request -- it is separated from the internal
> organization of the
> server-side code.
>
> When the controller servlet is started, part of the
> configuration is a
> set of
> mappings from the various request URIs to "action"
> classes -- that is,
> those that
> implement the Action interface.  The first time you
> use a particular
> action class,
> the controller servlet instantiates an instance of
> the corresponding
> class (saving
> this instance away for use later), and calls the
> perform() method of the
> action
> class.  The perform() method initiates the
> appropriate actions, and then
> returns an
> ActionForward object identifying the JSP page
> (typically) which should
> be used to
> display the next stage of the user interface.  (For
> those of you
> following my
> descriptions of "Model 2", this is a new feature
> that was suggested
> during our
> discussions.)  The forwarding object is typically
> looked up by logical
> name, so you
> can say "please forward to the List Customers" page,
> without knowing
> what the
> actual JSP page name is -- again, working towards
> separation of the
> layers in the
> MVC pattern.
>
> NOTE:  Tonight's nightly build of Struts, at
> <http://jakarta.apache.org/struts>,
> will contain the most up-to-date version of these
> features.
>
> >
> > I sincerely thank you for showing some direction.
>
> There have been numerous discussions of this general
> design pattern on
> JSP-INTEREST
> over the last year or so.  Access the archives of
> this list
> <http://archives.java.sun.com> and search for the
> term "Model 2" to see
> some of
> these discussions.
>
> >
> > Manisha.
>
> Craig
>
>
> >
> > --- "Craig R. McClanahan"
> > <[EMAIL PROTECTED]> wrote:
> > > Manisha Menon wrote:
> > >
> > > > Hi Craig,
> > > >
> > > > Exactly ! We have done in the same way.
> > > >
> > > > 1. Getting the action name from the hidden
> field.
> > > > String action_name =
> > > > request.getParameter("ACTION_NAME");
> > > >
> > > > Then instantiating the business object in
> either
> > > of
> > > > the following ways.
> > > >
> > > > a) BusinessInterface businessObject =
> > > (BusinessObject)
> > > > action_name;
> > > >
> > > > b) BusinessInterface businessObject =
> > > >
> > >
> >
>
BusinessObjectfactory.createBusinessObject(action_name);
> > > >
> > > > But I would like to know from you, whether
> this
> > > > approach is not running short of anything ?
> > > >
> > > > I have seen few of the approaches made use of
> > > event
> > > > delagation methodology. Can someone explain
> that
> > > > methodology in web context and also a possible
> > > > comparison between the two ? I am sorry if I
> am
> > > trying
> > > > to bring something unusual here.
> > > >
> > > > Thank you foryour replies,
> > > >
> > > > Manisha
> > > >
> > >
> > > This doesn't directly address your questions,
> but
> > > you might want to take a look at
> > > the Struts framework at
> > > <http://jakarta.apache.org/struts>, which
> provides a
> > > fleshed out framework for the MVC controller
> servlet
> > > and action dispatcher, plus
> > > some nice support for dealing with forms and
> > > internationalized applications through
> > > a JSP custom tag library.
> > >
> > > For simple applications, I implement my business
> > > logic in the action class that
> > > gets invoked by the controller servlet.  For
> more
> > > complex needs, I think of the
> > > action class as following the "adapter" design
> > > pattern, translating the HTTP
> > > request parameters into appropriate property
> setter
> > > calls on business logic beans
> > > (either EJBs or regular JavaBeans).  The
> business
> > > logic beans, then, are insulated
> > > from the fact that they were invoked in a web
> > > application, so you can reuse them
> > > elsewhere.
> > >
> > > Craig McClanahan
> > >
> > >
> > > >
> > > > --- "Craig R. McClanahan"
> > > > <[EMAIL PROTECTED]> wrote:
> > > > > Manisha Menon wrote:
> > > > >
> > > > > > Hi all,
> > > > > >
> > > > > > I know the question is very silly, but I
> am
> > > sorry
> > > > > I
> > > > > > could not avoid asking your help.
> > > > > >
> > > > > > I follow the MVC design methodology in my
> web
> > > > > > framework which has got servlets, jsp and
> > > beans.
> > > > > >
> > > > > > JSP page forwards the request to the
> > > controller
> > > > > > servlet requesting for a certain action.
> > > > > > The servlet controller after receiving the
> > > request
> > > > > > object,instantiates the appropriate
> > > > > > business bean, which will use connection
> pool
>
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Send instant messages with Yahoo! Messenger.
http://im.yahoo.com/

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to