Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What does the Controller really do in MVC?

167 views
Skip to first unread message

luserdroog

unread,
Dec 2, 2021, 9:24:09 PM12/2/21
to
I'm trying to make a simple web app that displays a piano-roll
style grid that you can click in to activate or deactivate notes.
And I'm building it off of the MVC classes that I borrowed from
Michael Haufe. But I feel like I'm not really making use of the
Controller part.

What does the Controller really do in an MVC design? Should I
stuff all my button handlers (and their helper functions) in there?
In the current implementation, the Controller is just 4 functions
to access an associated Model and View.

class Controller {
getModel(){ return this._model; }
setModel( model ){ this._model = model; }
getView(){ return this._view; }
setView( view ){ this._view = view; }
}

Is there more stuff it could do? Or more stuff it ought to do according
to other interpretations of MVC?

luserdroog

unread,
Dec 3, 2021, 1:34:13 AM12/3/21
to
I stumbled upon this concise answer.
https://stackoverflow.com/a/8497887/733077
which suggests that yes, the controller should encapsulate all the
"actions" and do manipulations on the model. The way I'm doing it
now, the model manipulates itself.

Elhwen Dico

unread,
Dec 3, 2021, 8:44:47 AM12/3/21
to
In my understanding,

Model is passive. It just ensure data store coherency. It handle
semantics of the application, invariants, ...

Views display Model in the UI. Views listen to Model to ensure
accuracy of display. Views also display widgets that let the user
interact (buttons, text fields).

Controllers listen Views for User interactions and translate its as
actions on the model. Theese interactions update the Model that notify
Views that update to display the new state.



luserdroog

unread,
Dec 3, 2021, 10:09:13 PM12/3/21
to
Ok. Yeah, that makes sense. This sounds like a more "classical" MVC
division. So if I wanted to move towards this with my piano roll app,
then my Control Panel should be a View or maybe even each button.
Then the View gets event notifications, passing those to the Controller.
And the Controller should have all my app's "actions". In the piano roll
app all these actions are currently methods of the Model, so they
ought to be methods of the Controller, called when the controller gets
an event from View.

That does seem like a more "organized" organization than the way
I'm doing it now.

Michael Haufe (TNO)

unread,
Dec 4, 2021, 4:52:53 PM12/4/21
to
On Thursday, December 2, 2021 at 8:24:09 PM UTC-6, luser...@gmail.com wrote:
> I'm trying to make a simple web app that displays a piano-roll
> style grid that you can click in to activate or deactivate notes.
> And I'm building it off of the MVC classes that I borrowed from
> Michael Haufe. But I feel like I'm not really making use of the
> Controller part.
> [...]

I threw together a quick MVC example this morning. Imperfect and a bit verbose but conceptually
you might find it useful:

<https://codepen.io/mlhaufe/pen/eYGpBzE?editors=0011>

Julio Di Egidio

unread,
Dec 5, 2021, 5:52:39 AM12/5/21
to
That is not MVC, indeed that is just nonsensical.

When Dunning-Kruger is a compliment...

*Plonk*

Julio

Michael Haufe (TNO)

unread,
Dec 5, 2021, 12:28:04 PM12/5/21
to
Your betaness is showing. You're never one to write code just drive-by noise from a lesser mortal. Feel free to actually write some. I even started you off with an example...

Julio Di Egidio

unread,
Dec 5, 2021, 6:01:22 PM12/5/21
to
On Sunday, 5 December 2021 at 18:28:04 UTC+1, Michael Haufe (TNO) wrote:
> On Sunday, December 5, 2021 at 4:52:39 AM UTC-6, ju...@diegidio.name wrote:
> > On Saturday, 4 December 2021 at 22:52:53 UTC+1, Michael Haufe (TNO) wrote:
> > > On Thursday, December 2, 2021 at 8:24:09 PM UTC-6, luser...@gmail.com wrote:
> > > > I'm trying to make a simple web app that displays a piano-roll
> > > > style grid that you can click in to activate or deactivate notes.
> > > > And I'm building it off of the MVC classes that I borrowed from
> > > > Michael Haufe. But I feel like I'm not really making use of the
> > > > Controller part.
> > > > [...]
> > >
> > > I threw together a quick MVC example this morning. Imperfect and a bit verbose but conceptually
> > > you might find it useful:
> > >
> > > <https://codepen.io/mlhaufe/pen/eYGpBzE?editors=0011>
> > That is not MVC, indeed that is just nonsensical.
> >
> > When Dunning-Kruger is a compliment...
> >
> > *Plonk*
>
> Your betaness is showing. You're never one to write code just drive-by noise from a lesser mortal. Feel free to actually write some. I even started you off with an example...

My "betaness", you piece of shit?? Your code *is* fucking pathetic, but Dunning-Kruger remains a compliment: I *do* have posted so many code already, you retarded piece of lying shit, you and co., including a didactic example of MVC + knockout + timers + what-not, and *you* were not even able to understand what was what...!! You yet another planetary fucking *fraud*.

*Plonk*

Julio

Thomas 'PointedEars' Lahn

unread,
Dec 5, 2021, 7:11:24 PM12/5/21
to
Michael Haufe (TNO) wrote:

> Your betaness is showing. […]

:-D

--
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.

luserdroog

unread,
Dec 5, 2021, 8:09:26 PM12/5/21
to
Very cool. Thanks. It seems that my problem is not applying MVC per se, but applying
Object Orientation more generally. But my big take-away is that the app itself *is* the
controller, or more perspicuously an instance of a subclass of a controller.

That both answers my question and sheds light on my X/Y problem to boot.
Nice one. Thanks again.

Julio Di Egidio

unread,
Dec 6, 2021, 2:53:42 AM12/6/21
to
I do not have it with your patent mental retardedness, I have it with your lack of any good faith.

Bunch of retarded cunts, parasites and polluters of all ponds. ESAD.

*Plonk*

Julio

Julio Di Egidio

unread,
Dec 6, 2021, 2:55:14 AM12/6/21
to
It's the usual piece of crap code and compendium of all one should NOT do.

You spamming pieces of shit. ESAD, both of you!

*Plonk*

Julio

Jonas Thörnvall

unread,
Dec 6, 2021, 5:04:31 AM12/6/21
to
Your just so anal Julio i think the programmer paradigm have eaten you. You can do things not by the book and still get results.
This is a 50$ soundcanvas SC-7 one of Rolands first, played on an old Tascam FW1884 device.

A song played up with my vanilla javascript sequenser through the gear i mention above 200$ total, it ought to sound shit but it sounds lovely, because even i know my programming skills really not there i put my effort where it matter.
I would say the recording abilities match the playup, if not too aggresively hit with input data.
https://www.facebook.com/jonas.thornvall/videos/886147958755444

Jonas Thörnvall

unread,
Dec 6, 2021, 5:08:59 AM12/6/21
to
måndag 6 december 2021 kl. 08:55:14 UTC+1 skrev ju...@diegidio.name:
https://jtmidi.000webhostapp.com/

Julio Di Egidio

unread,
Dec 7, 2021, 9:10:35 AM12/7/21
to
On Monday, 6 December 2021 at 11:04:31 UTC+1, jonas.t...@gmail.com wrote:

> Your just so anal Julio i think the programmer paradigm have eaten you.

You asshole(s) have just got no clue what *programming* even means.

So let me give you a kick-start: there is no such thing as a "programming
paradigm", but there is such essential thing as a *programming discipline*.
An engineering discipline, to be specific.

> You can do things not by the book and still get results.

Meanwhile an entire and truly critical industry gone down the drain...

You bloody morons.

(HTH.)

Julio

Arno Welzel

unread,
Dec 7, 2021, 1:30:56 PM12/7/21
to
Julio Di Egidio:

[...]
> My "betaness", you piece of shit?? Your code *is* fucking pathetic,
> but Dunning-Kruger remains a compliment: I *do* have posted so many
> code already, you retarded piece of lying shit, you and co.,
> including a didactic example of MVC + knockout + timers + what-not,
> and *you* were not even able to understand what was what...!! You
> yet another planetary fucking *fraud*.
>
> *Plonk*

1) You don't know what "Plonk" means - otherwise you would not even have
read the post which you replied to.

To "plonk" someone means to add the sender to a killfile to ignore all
future postings. Obviously you don't even know what a killfile is. You
just write "*Plonk*" but still read everything someone writes.

2) What exactly do you think to achiev with calling someing "piece of
shit", "piece of lyging shit", "another planetary fraud" etc.?



--
Arno Welzel
https://arnowelzel.de

Arno Welzel

unread,
Dec 7, 2021, 1:32:34 PM12/7/21
to
Julio Di Egidio:

[...]
> It's the usual piece of crap code and compendium of all one should NOT do.
>
> You spamming pieces of shit. ESAD, both of you!
>
> *Plonk*

ROTFLMAO

Is this a bot? I can't believe that any sane real person ever acts like
this.

Arno Welzel

unread,
Dec 7, 2021, 1:36:05 PM12/7/21
to
Julio Di Egidio:

> On Monday, 6 December 2021 at 11:04:31 UTC+1, jonas.t...@gmail.com wrote:
>
>> Your just so anal Julio i think the programmer paradigm have eaten you.
>
> You asshole(s) have just got no clue what *programming* even means.

And you have no clue how to communicate without trying to insult people
all the time. Do you have a tourette syndrome?

> So let me give you a kick-start: there is no such thing as a "programming
> paradigm", but there is such essential thing as a *programming discipline*.

There is a programming paradigm, maybe just not in your world:

<http://people.cs.aau.dk/~normark/prog3-03/html/notes/paradigms_themes-paradigm-overview-section.html>

<https://books.google.de/books?id=_bmyEnUnfTsC&redir_esc=y>

<https://www.info.ucl.ac.be/~pvr/VanRoyChapter.pdf>

Jonas Thörnvall

unread,
Dec 7, 2021, 1:43:02 PM12/7/21
to
Have you ever noticed Julio its never the anal obsessed disciplined that come up with the good ideas, they are just caretakers of ideas, they love to drivel in documentation.
They are just the janitors of ideas LoL.

That said obviously both parties needed, to get anything done.

Julio Di Egidio

unread,
Dec 8, 2021, 2:53:48 AM12/8/21
to
Another resident retarded cunt retorts with some links... but, can you even read English? As I have *repeatedly* pointed out around here, the whole arena has been hijacked and flooded with just FRAUDULENT BULLSHIT since the mid '90s.

But, even that aside, *you* cannot discern, but those articles you together with the whole bandwagon take for gospel, are utterly fucking WRONG on the WHOLE line!! Just you don't know shit and will only trust your authorities...

And, even aside that, you fucking retarded cunt: one thing is "coding paradigms" a la functional vs imperative, another is "*the* programming paradigm" a la Jonas and a la what a bunch of fucking retarded polluters of all ponds you are.

And even said that, what just a *sucker* in fact you are, by the way...

Just fuck off you and this pathetic rotten brigade. (EOD.)

*Plonk*

Julio

Arno Welzel

unread,
Dec 8, 2021, 3:27:01 AM12/8/21
to
Julio Di Egidio:

> Just fuck off you and this pathetic rotten brigade. (EOD.)
>
> *Plonk*

As usual.

Julio Di Egidio

unread,
Dec 8, 2021, 3:37:00 AM12/8/21
to
On Wednesday, 8 December 2021 at 09:27:01 UTC+1, Arno Welzel wrote:
> Julio Di Egidio:
>
> > Just fuck off you and this pathetic rotten brigade. (EOD.)
> >
> > *Plonk*
>
> As usual.

As usual you just cannot even read.

How fucking *pathetic*.

*Plonk*

Julio

John Harris

unread,
Dec 8, 2021, 2:54:48 PM12/8/21
to
On 08/12/2021 07:53, Julio Di Egidio wrote:

<snip>
> As I have *repeatedly* pointed out around here, the whole arena has been hijacked and flooded with just FRAUDULENT BULLSHIT since the mid '90s.
<snip>
And you have *repeatedly* failed to say it clearly enough for us to work
out why you say that.

Hint : Curses aren't clear enough.

John

Julio Di Egidio

unread,
Dec 8, 2021, 4:25:22 PM12/8/21
to
Learn to use question marks, you bunch of pieces of lying shit.

Indeed, be reassure, you stupid lying nazi retarded cunts: I am indeed
gonna call everybody by their fucking real name from this point on with
no discounts made, until either you get a grip or you get at least as
livid as the fucking poison you keep spilling makes everything that
breathes.

You fucking *retarded cunts*, ESAD.

*Plonk*

Julio

The Natural Philosopher

unread,
Dec 9, 2021, 4:33:42 AM12/9/21
to
With that amount of anger., perhaps coding is an occupation that you
should eschew in favour of - say - needlepoint, or flower arranging?


--
Religion is regarded by the common people as true, by the wise as
foolish, and by the rulers as useful.

(Seneca the Younger, 65 AD)

Jonas Thörnvall

unread,
Dec 9, 2021, 10:53:36 AM12/9/21
to
LoL

John Harris

unread,
Dec 9, 2021, 2:42:09 PM12/9/21
to
On 09/12/2021 09:33, The Natural Philosopher wrote:
> On 08/12/2021 21:24, Julio Di Egidio wrote:

<snip>
>> Julio
> With that amount of anger., perhaps coding is an occupation that you
> should eschew in favour of - say - needlepoint, or flower arranging?

It's a characteristic of Julio. After talking sensibly for a day or two
he switches into cursing mode with no information content at all. It's
rather sad.

John

The Natural Philosopher

unread,
Dec 9, 2021, 2:44:38 PM12/9/21
to
Probably chemical


--
The New Left are the people they warned you about.

Arno Welzel

unread,
Dec 10, 2021, 5:51:13 AM12/10/21
to
Julio Di Egidio:
As usual. You say "*Plonk*" but you don't even know what that means and
continue to read all I write.

Are you sure that you are human and not a bad copy of ELIZA?

Jan van den Broek

unread,
Dec 10, 2021, 7:07:58 AM12/10/21
to
On 2021-12-10, Arno Welzel <use...@arnowelzel.de> wrote:

[Schnipp]

> Are you sure that you are human and not a bad copy of ELIZA?

ELIZA was fun.
--
Jan v/d Broek
balg...@dds.nl

Julio Di Egidio

unread,
Dec 10, 2021, 7:50:09 AM12/10/21
to
On Friday, 10 December 2021 at 13:07:58 UTC+1, Jan van den Broek wrote:
> On 2021-12-10, Arno Welzel <use...@arnowelzel.de> wrote:
>
> [Schnipp]
> > Are you sure that you are human and not a bad copy of ELIZA?
>
> ELIZA was fun.

There is fun and fun: the fun you should look for here is simply not the same as the fun you'd e.g. look for at the pub. And learning is *a lot* of fun, when it happens...

Julio

Jon Ribbens

unread,
Dec 10, 2021, 7:56:48 AM12/10/21
to
On 2021-12-10, Arno Welzel <use...@arnowelzel.de> wrote:
> Julio Di Egidio:
>> On Wednesday, 8 December 2021 at 09:27:01 UTC+1, Arno Welzel wrote:
>>> Julio Di Egidio:
>>>> Just fuck off you and this pathetic rotten brigade. (EOD.)
>>>>
>>>> *Plonk*
>>>
>>> As usual.
>>
>> As usual you just cannot even read.
>>
>> How fucking *pathetic*.
>>
>> *Plonk*
>
> As usual. You say "*Plonk*" but you don't even know what that means and
> continue to read all I write.

Sorry, you're misunderstanding him. When Plonk Julio says "Plonk",
he is not saying *he* is plonking *you*, he is making the very
sensible and worthwhile suggestion that *you* plonk *him*.
It's excellent advice.

Julio Di Egidio

unread,
Dec 10, 2021, 8:06:40 AM12/10/21
to
That is nearer to the truth than you would guess.

I have in fact explained several times in the paste to you suckers how I use it, you just won't read...

*Plonk*

Julio

Thomas 'PointedEars' Lahn

unread,
Dec 10, 2021, 7:54:40 PM12/10/21
to
Jon Ribbens wrote:

> On 2021-12-10, Arno Welzel <use...@arnowelzel.de> wrote:
>> Julio Di Egidio:
>>> *Plonk*
>>
>> As usual. You say "*Plonk*" but you don't even know what that means and
>> continue to read all I write.
>
> Sorry, you're misunderstanding him. When Plonk Julio says "Plonk",
> he is not saying *he* is plonking *you*, he is making the very
> sensible and worthwhile suggestion that *you* plonk *him*.
> It's excellent advice.

YMMD :-D

Julio Di Egidio

unread,
Dec 11, 2021, 4:09:54 AM12/11/21
to
On 11/12/2021 01:54, Thomas 'PointedEars' Lahn wrote:
> Jon Ribbens wrote:
>
>> On 2021-12-10, Arno Welzel <use...@arnowelzel.de> wrote:
>>> Julio Di Egidio:
>>>> *Plonk*
>>>
>>> As usual. You say "*Plonk*" but you don't even know what that means and
>>> continue to read all I write.
>>
>> Sorry, you're misunderstanding him. When Plonk Julio says "Plonk",
>> he is not saying *he* is plonking *you*, he is making the very
>> sensible and worthwhile suggestion that *you* plonk *him*.
>> It's excellent advice.
>
> YMMD :-D

Of all the incompetent morons, suckers and plain retarded spamming cunts
that have hijacked this place, you are by far the most retarded...

*Troll Alert*

Julio
0 new messages