By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,009 Members | 1,643 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,009 IT Pros & Developers. It's quick & easy.

Command Pattern and Model 2

P: n/a
Hi

I tring to implement a model 2 architecture in a new test JSP site for my
own training. I read this article
http://java.sun.com/blueprints/guide...web-tier5.html

It suggests that I in my controlling servlet use at Command Pattern to
control the flow instead of if-else. Sounds great. The patten is examplified
in section 4.6 and 4.7

But here come my problem. The author use a class wich he calss Model. This
class he passes to every instance of classes wich inherit from Action.
Eg.CreateUserAction. But he has not shown what the Model clas should look
lige. Since he calls a funktion on the model object called createUser() my
only thougt is, that this class implements ALL methods wich the servlet
should use. I think thats seems wuite odd, and ugly. So my conlussion is
that i misundestand it. Anthoer thougt was that the Model calss was an
abstract class. But that of course doesent make sence since he dosent cast
it to anything mere specefic when he calls the createUser method,

Hope someone can clear things up.
Regards
Anders J, Denmark
Problemet er den klasser som hedder Model. Denne er ikke defineret nogen
steder og jeg kan ikke forstå dens funktion. Jeg kan udfra koden se at der
bliver kaldt model.createUser hvilket for mig ikke rigtig giver mening. Det
vil for mig set betyde at denne klasse skal have samtlige metoder som mit
site skal kunne. Det kan heller ikke passe at Model er en basisklasse da han
jo kalder fx. createUser uden at kaste den til en specifik Model
implementering.

Håber nogen kan rede dette ud. Det er froøvrigt i forbindelse med
implementering af Model 2 (MVC) pattern.

Mvh
Anders J


Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.