Hi! > From: Volker Schneider [mailto:[EMAIL PROTECTED]] > > Dear colleagues, > > for developing a web application we thought about an > architecture using the > model-view-controller architecture pattern. Can somebody help > me and say > whether this is a good or bad idea?
It's not a bad idea ;) > > First the request goes to from a form to an action set, where > the following > things are handled in separate actions: > > - session validation > - authentication validation > - form validation You can have multiple actions sets for these and you can also use nested matchers. E.g.: <match> <!-- Perform all the common logic here, like session handling, authentication, logging, etc. --> <match> <!-- Perform specific actions --> </match> <match> <!-- Perform specific actions --> </match> </match> > > The next action accesses the business logic and decides, > which page will be > shown next. Maybe business logic returns an error, so an > error page can be > displayed. The name of the next page will be stored in a > request attribute. Yup. > > This action contains the pipeline which uses a > serverpages-generator and a > xsp-File. The xsp-File retrieves the stored results from the > session and > builds the input for the serverpages generator. The xsp will > produce all the > content needed for displaying the page, except the > presentation information. If you use JavaBeans as your value objects then I'd use CastorTransformer to marshal them into XML then transform using XSLT. > > Presentation information will be added through a transformer and a > xsl-stylesheet. Yes. In some cases you would like to use additional transformers as well (e.g. i18n, URL rewriting, etc.) > > The last step is an ordinary html serializer. Yup. > > What do you think, is it too complicate? Will we get problems with > performance? Is there an easier way to reach the same goal > (MVC pattern)? There are several ways doing it in Cocoon: use sitemap only solution using actions, look at the Schecoon in Cocoon scratchpad and use the flow script for your navigation logic (based on JavaScript). Also, the content generation part can be done in multiple ways. > What is a typical architecture using cocoon? See Cocoon scratchpad in CVS, especially: src\scratchpad\webapp\mount\xmlform - form handling and wizards src\scratchpad\webapp\mount\precept - another form handling and wizards src\scratchpad\webapp\mount\castor - marshalling objects into XML (See their sources too) See also: src\scratchpad\schecoon - script based flow control Regards, Konstantin > > Thank you, best regards > - Volker - > > > --------------------------------------------------------------------- > Please check that your question has not already been answered in the > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> > > To unsubscribe, e-mail: <[EMAIL PROTECTED]> > For additional commands, e-mail: <[EMAIL PROTECTED]> > --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>