473,473 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Wondering about MVC

BSCode266
38 New Member
Hey all,

I was kinda wondering about how many people here have actually used or are using the Model-View-Controller-model. Is it really usefull?

for those who wonder what MVC is: http://en.wikipedia.org/wiki/Model-view-controller

BSCode266
Apr 9 '07 #1
13 3385
hirak1984
316 Contributor
yes many here are using/had used MVC

all the standard frameworks are based on this model.
but why are u asking?
do you have a better design to write codes?
please let us know...
Hey all,

I was kinda wondering about how many people here have actually used or are using the Model-View-Controller-model. Is it really usefull?

for those who wonder what MVC is: http://en.wikipedia.org/wiki/Model-view-controller

BSCode266
Apr 9 '07 #2
BSCode266
38 New Member
yes many here are using/had used MVC

all the standard frameworks are based on this model.
but why are u asking?
do you have a better design to write codes?
please let us know...
Well they tried to teach it to me in school, but some the teacher didnt show up 2 out of 4 classes so i started wondering is it worth learning. After a while i have been trying to understand it but without someone properly teaching it to ya its kinda hard to find out. Right now i am making an old assignment of a microwave in mvc or at least i think i do. So i thought i'd ask.

What do you mean with all the standard frameworks? And would the MVC-model be the best way to do it?

BSCode266
Apr 9 '07 #3
JosAH
11,448 Recognized Expert MVP
Personally I never allow my Views to talk with the Model directly.This changes
the triangle shaped pattern to a simple bidirectional pipeline:

View <-------> Controller <-------> Model

... and turns the Controller classes into a simple more Mediator like pattern
and it keeps the View as stupid as possible (which is AGT (A Good Thing (tm)).

kind regards,

Jos
Apr 9 '07 #4
BSCode266
38 New Member
Personally I never allow my Views to talk with the Model directly.This changes
the triangle shaped pattern to a simple bidirectional pipeline:

View <-------> Controller <-------> Model

... and turns the Controller classes into a simple more Mediator like pattern
and it keeps the View as stupid as possible (which is AGT (A Good Thing (tm)).

kind regards,

Jos
I see, but then how do you update your view? Isnt view supposed to update according to the model? do you give this task also to the controller?

Another thing, Controller is just supposed to handle input right? so then if you would change your controller in an eventhandler this wouldnt be wrong?

And what about something called an Observer? i kinda came across this in a powerpoint explaining MVC but have no idea what it is or does.

I have attached the uml. Sorry about the poor quality.
Attached Images
File Type: jpg UML MVC.jpg (50.1 KB, 4924 views)
Apr 9 '07 #5
JosAH
11,448 Recognized Expert MVP
I see, but then how do you update your view? Isnt view supposed to update according to the model? do you give this task also to the controller?
Yep, for simple things the Controller just passes it along from the Model to
the View. For more complicated things the Controller should be the destination
of the fired event anyways.

Another thing, Controller is just supposed to handle input right? so then if you would change your controller in an eventhandler this wouldnt be wrong?
I wouldn't be wrong, both the Model and the View generate events and the
Controller catches them all and decides what to do with them.When the View
fires an event the user was the actual cause. When a Model fires an event it
was just because some data changes or some business status has changed.
Let the Controller handle it and update the View/Model whenever necessary.

And what about something called an Observer? i kinda came across this in a powerpoint explaining MVC but have no idea what it is or does.
An Observer is the same as a Listener (in Java speak). The Observer simply
listens for events fired by an Observable. The pure Observer/Observable
implementations in Java are next to useless given the fact that the
PropertyChangeSupport class can handle it in a far more flexible way.

kind regards,

Jos
Apr 9 '07 #6
hirak1984
316 Contributor
Thinking in this way definitely helps.

I myself use this model.

Personally I never allow my Views to talk with the Model directly.This changes
the triangle shaped pattern to a simple bidirectional pipeline:

View <-------> Controller <-------> Model

... and turns the Controller classes into a simple more Mediator like pattern
and it keeps the View as stupid as possible (which is AGT (A Good Thing (tm)).

kind regards,

Jos
Apr 9 '07 #7
hirak1984
316 Contributor
well according to the new definations of M,V,C


View is the part that listenes to the change in model.(and renders it to the viewer)
Controller helps in select the appropriate view.
Model talks to the database.
Observer helps in selecting the appropriate model(it is like an array of models).

I see, but then how do you update your view? Isnt view supposed to update according to the model? do you give this task also to the controller?

Another thing, Controller is just supposed to handle input right? so then if you would change your controller in an eventhandler this wouldnt be wrong?

And what about something called an Observer? i kinda came across this in a powerpoint explaining MVC but have no idea what it is or does.

I have attached the uml. Sorry about the poor quality.
Apr 9 '07 #8
JosAH
11,448 Recognized Expert MVP
Thinking in this way definitely helps.

I myself use this model.
I like it too with the communication between a View and Model cut away
from the pattern. There are perfect examples why this makes sense; e.g.
JSPs dealing with a database directly are considered a big nono. JSPs
are for views, not for model fiddling. I for one don't even understand why there
is database support in the JSTL (its 'sql' tags). It is bad practice especially
when separate tiers are involved. And above all: those 'sql' tags assume that
I want to work using sql which I don't because it's extremely primitive compared
to object oriented databases available nowadays ;-)

kind regards,

Jos
Apr 9 '07 #9
BSCode266
38 New Member
Thanks guys, this sure made it alot clearer. Now i understand why they want me to use it. Should one always try to use this, i mean is it some sort of standard that you make bigger programs with MVC?

BSCode266
Apr 9 '07 #10
JosAH
11,448 Recognized Expert MVP
Thanks guys, this sure made it alot clearer. Now i understand why they want me to use it. Should one always try to use this, i mean is it some sort of standard that you make bigger programs with MVC?

BSCode266
Well, that MVC stuff is 'best practice' which is one of the prerequisites to make
it a pattern. If someone comes up with something better I think it's better to
use that something else. But it always makes sense to 'separate concerns'
(another OO mantra) so it's a good thing to separate the I/O from the business
logic and separate that from your (data) model; no matter how small your
application is.

kind regards,

Jos
Apr 9 '07 #11
hirak1984
316 Contributor
Well can you give some more ideas about object oriented databases...

I am totally unaware about them.

I like it too with the communication between a View and Model cut away
from the pattern. There are perfect examples why this makes sense; e.g.
JSPs dealing with a database directly are considered a big nono. JSPs
are for views, not for model fiddling. I for one don't even understand why there
is database support in the JSTL (its 'sql' tags). It is bad practice especially
when separate tiers are involved. And above all: those 'sql' tags assume that
I want to work using sql which I don't because it's extremely primitive compared
to object oriented databases available nowadays ;-)

kind regards,

Jos
Apr 9 '07 #12
JosAH
11,448 Recognized Expert MVP
Well can you give some more ideas about object oriented databases...

I am totally unaware about them.
Check out Cache (with an accent-aegue (sp?)) on the 'e' by Intersystems.
That DB is a lot of fun to work with, especially their 'Jalapeno' technology
that allows persistence of your POJOs (Plain Old Java Objects) without the
need of all that OR mapping stuff. As far as I can tell now the DB scales
well too which is another advantage (I must confess) I didn't exprect.

My prediction is that all that clumsy Object-Relational mapping is doomed
to disappear very soon (except for those darn legacy applications) and that
might well take away all those clunky entity beans and those silly QLs.

kind regards,

Jos

ps. I'm not related to Intersystems whatsoever and I'm sure other companies
have come up with similar technologies as well.
Apr 9 '07 #13
hirak1984
316 Contributor
hey thnx... surely will check them out...
Check out Cache (with an accent-aegue (sp?)) on the 'e' by Intersystems.
That DB is a lot of fun to work with, especially their 'Jalapeno' technology
that allows persistence of your POJOs (Plain Old Java Objects) without the
need of all that OR mapping stuff. As far as I can tell now the DB scales
well too which is another advantage (I must confess) I didn't exprect.

My prediction is that all that clumsy Object-Relational mapping is doomed
to disappear very soon (except for those darn legacy applications) and that
might well take away all those clunky entity beans and those silly QLs.

kind regards,

Jos

ps. I'm not related to Intersystems whatsoever and I'm sure other companies
have come up with similar technologies as well.
Apr 10 '07 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Chris | last post by:
I've written a small QBASIC program which draws a spiral. Here is the code: SCREEN 12 CLS FOR t = 1 TO 400 STEP .01 x = .5 * t * COS(t) y = .5 * t * SIN(t) PSET (x + 320, y + 240) NEXT t
11
by: Steven Burn | last post by:
Just wondering if it would be possible to convert an existing e-mail form to; 1. Send the e-mail (as it does now...without problems) 2. Copy one folder on the server, to another new folder ...
2
by: KevinGPO | last post by:
Just wondering if anyone knows if there are converters to convert from: MS Visual C++ 6.0 or MS Visual Studio 2003 project files into UNIX autogen/configure/make files?
8
by: MLH | last post by:
A97 HELP shows the proper syntax for using Nz as Nz(variant) I'm wondering what to expect from potential past misuse I've made. For example, consider the following... Private Sub...
5
by: scorpion53061 | last post by:
I would like your thoughts and impressions of the events of today and ask how you would handle this or if I am wrong and this is "normal" behaviour for a web provider and IIS. I am normally a...
1
by: rodchar | last post by:
hey all, you know how you can drag a Crystal Report into a web form with a Viewer from the toolbar, so i was just wondering if there was a way to take fields in a datasource and combine them in...
3
by: rodchar | last post by:
hey all, i was wondering why I've seen articles similar to the following: ADO.NET Code Generator - Map DataBase Objects To .NET Classes What does this subject accomplish? Like, this does...
16
by: rodchar | last post by:
Hello all, Please allow me to revisit this topic once more it has hindered me for the longest. Even after the great replies I got in the past. I guess they might have been a bit over my head or...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.