LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Is my understanding of MVC correct? (https://www.linuxquestions.org/questions/programming-9/is-my-understanding-of-mvc-correct-4175668186/)

snowmagician 01-22-2020 04:25 AM

Is my understanding of MVC correct?
 
( USER )

[ View ] deals with displaying to the user

[ Controller ] deals with dealing with user interactions

[ Model ] deals with the database and the mechanics of the overall application

{ DATABASE } such as Mongo db or MySQL

rtmistler 01-22-2020 07:42 AM

Seems accurate from the chapter and verse for MVC.

I have to be honest, I'm not a huge proponent of design patterns.

Can I ask, why you're asking?

For me the only reason why things like this ever come up is that they're part of a job description, and I've found many times that they are meaningless to the actual job in question.

snowmagician 01-22-2020 08:47 AM

1 - I am trying to get a job as a python developer
2 - Python developers are expected to have a GitHub repository and be aware of python frameworks such as Django
3 - Django is based on MVC

You are welcome to tell me advices

boughtonp 01-22-2020 09:49 AM

There are several subtly different interpretations/implementations of MVC, so you'll probably get conflicting advice.

For example, I disagree with what you've written and would say something more like:

M = deals with the data model of the application
V = deals with displaying and interacting with the user
C = connects the M and V and controls the flow

But do the differences there matter? So long as the application is correct, easily maintainable, and performs ok, it's not usually a big issue.

Exact definitions are less important than understanding how (e.g.) Django works, so if you're after a Python job then you should focus on learning & practising the skills that will help with that.


dugan 01-22-2020 10:10 AM

Your top post sounds sounds right for Django, yes.

Note that the reason these web frameworks were called "MVC" was largely to distinguish them from old-timey ASP, JSP and PHP, where you'd have all your code embedded in the HTML pages. Those HTML pages were sometimes called "server pages".

SoftSprocket 01-23-2020 08:11 AM

Quote:

Originally Posted by dugan (Post 6081591)

Note that the reason these web frameworks were called "MVC" was largely to distinguish them from old-timey ASP, JSP and PHP, where you'd have all your code embedded in the HTML pages. Those HTML pages were sometimes called "server pages".

My memory suggests MVC goes back to Smalltalk and the GoF and migrated into Enterprise Java where they created an administrative mess of job titles in an effort to remove any creativity form the hands of programmers and give management the sense that their projects won't lead them on the path to ruin. I'm not sure it worked.


All times are GMT -5. The time now is 12:22 PM.