473,396 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Command Pattern and Model 2

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
0 2125

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tony Marston | last post by:
For those who you thought my method of implementing OO principles in PHP was totally wrong - see http://www.tonymarston.co.uk/php-mysql/good-bad-oop.html for details, you can now read...
1
by: TEK | last post by:
Hello I'm wondering if anyone out there might give some input/suggestions/viewpoints around the Command pattern. In my case, the number one priority for using the pattern is undo support. Some...
0
by: David Veeneman | last post by:
I've posted an article on CodeProject that discusses implementing the Command pattern in a Model-View-Controller architecture. I'd appreciate comments on the article. Here is the article's URL: ...
4
by: FluffyCat | last post by:
New on November 29, 2005 for www.FluffyCat.com PHP 5 Design Pattern Examples - the Command Pattern. Since you all enjoyed the Visitor Pattern so much yesterday, today I have the Command Pattern...
1
by: Marcel Hug | last post by:
Hi NG ! I have already written a task about MVC and I tried to get the best informations together. I would like to implement the MVC pattern and it work on the way I did it. At first i know the...
2
by: anonymous.user0 | last post by:
Ok, this is kinda dumb. I'm trying to wrap my head around the use of the MVC and Command Patterns. The questions basically concern where to place code. In the MVC pattern, where are the Commands...
6
by: Bill44077 | last post by:
Hi, I am new to the MVP pattern and one of the main reasons that we are going this route is because we are doing Scrum with 30 day sprints - so we have a continually morphing design. We are...
1
by: halekio | last post by:
Hi all, Please bear with me as I've only started programming in C# 2 weeks ago and this is my first contact with OOP. I ran into a situation where I needed to catch an event in an object that...
3
by: Gav | last post by:
I have just started to rewrite my application using the Presenter First Design Pattern to make sure my business logic is not in the Gui itself. I've got the general idea but I'm a bit unsure as to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.