Is this separation of content and logic?

J

jmDesktop

I have this from javapassion.com:

<html>
<body>
hello world!
<br>
Current time is: <%= new java.util.Date() %>
</body>
</html>

Is this "model 2 architecture"? I did not think it was, but don't
know, which is why I am asking. If it is I'm not sure I know what
"logic" is in the mvc context. For the trivial this might be okay,
but not larger systems, imho.
 
D

Dave Miller

jmDesktop said:
I have this from javapassion.com:

<html>
<body>
hello world!
<br>
Current time is: <%= new java.util.Date() %>
</body>
</html>

Is this "model 2 architecture"? I did not think it was, but don't
know, which is why I am asking. If it is I'm not sure I know what
"logic" is in the mvc context. For the trivial this might be okay,
but not larger systems, imho.
This page might help explain model - view - controller (mvc) architecture:

http://en.wikipedia.org/wiki/Model-view-controller
 
A

Arne Vajhøj

jmDesktop said:
I have this from javapassion.com:

<html>
<body>
hello world!
<br>
Current time is: <%= new java.util.Date() %>
</body>
</html>

Is this "model 2 architecture"? I did not think it was, but don't
know, which is why I am asking.

It is not.

In MVC m2 the controller servlet or a class called from it would
store a value in the request object and the JSP page would display
that using EL.

Arne
 
T

Tom Anderson

I have this from javapassion.com:

<html>
<body>
hello world!
<br>
Current time is: <%= new java.util.Date() %>
</body>
</html>

Is this "model 2 architecture"? I did not think it was, but don't know,
which is why I am asking. If it is I'm not sure I know what "logic" is
in the mvc context. For the trivial this might be okay, but not larger
systems, imho.

It's an example that's so trivial that it's hard to classify it either
way. If working out the date involved contacting a database and doing some
calculations (IOW, if we were talking about enterprise-grade dates), and
that logic was spelled out here, this would be Model 1. If, on the other
hand, that logic was in the Date constructor, this would actually be Model
2.

Isn't there also some distinction about control flow, with Model 2 having
a master servlet receive all requests and then dispatch them to an
appropriate handler JSP?

tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top