4 ms·
This isn't a great example to me. I doubt the interviewers would disagree that the actual code in MVC runs at the "application tier". I think they were just t
by tyingq 5y ago
This isn't a great example to me. I doubt the interviewers would disagree that the actual code in MVC runs at the "application tier".
I think they were just trying to elicit the idea that the model defines interaction with the database and that the view defines interaction with the browser client. That there is some relation there between MVC and 3-tier architecture. The Wikipedia snippet that disputes any relationship seems overly pedantic to me.
Though all moot to me since there's very little real world pure MVC or pure "3-tier" anyway. For good reason.
- treis 5y agoSeconded. What they're calling the right answer is the pedantic answer.
- typon 5y agoDisagree. The difference is fundamental and if you don't know it you are going to be stuck with a false understanding of the framework you're working with - and you will likely end up trying to shove bad abstractions into places where they don't belong, resulting in an unmaintainable mess of code. I have seen this happen in a lot of codebases where people fundamentally misunderstand the abstractions they're building on top of.
- tyingq 5y agoI disagree with this. If you believe that one thing "3 tier" means is that the client doesn't interact directly with a database, as the old fat-client -> database model did, then "MVC" was one pattern to accomplish that. So, to me, there is some relationship. Enough of one to have a interview discussion about it. I do agree that they aren't the same thing, but they are pretty clearly related to me. The interview question was “How does this architecture relate to the model-view-controller pattern?”
- kingdomcome50 5y agoI find it to be pedantic as well. Sure, all of the code exists in the application layer. But that doesn't really tell you anything about it's relationship to the system as a whole does it? How about we look at vectors of change? Or dependency relationships? You see, in many systems changes[0] to the UI affect changes to the View and changes[1] to the database affect changes to the Model. [0][1] I don't mean to say the UI changes and then the View is updated to match. I mean that stakeholders will have decided that the UI needs to display different information, so the View is updated to accommodate such a change (which can then be passed to the UI). The same story above for the Model/Database relationship.
- LanceH 5y ago> “How does this architecture relate to the model-view-controller pattern?” It's an ambiguous question. One answer is that all the mvc code runs on the application layer. This correct in a nearly tautological way (the code is where the code is). The other answer is how does it relate. The model relates to the database in their three tier example. Indeed, I think this question definitely implies something other than "where does the mvc code exist?" I really don't think his answer is even a pedantic one. It's bending over backwards to read a question in a certain way that his preferred clever answer could be considered correct.
- commandlinefan 5y agoWell, no… the correct answer is that MVC and 3-tier are actually orthogonal concepts. And probably the better answer even in his given interview context.
- flavius29663 5y agoexactly. The author could have gone into the differences between the 2, how they are the same but not really, by choosing the words wisely. He could have made it a non-attack by interjecting "from my experience" or "from what I know" or "the way I usually refer to this" etc. There are no correct answers, since these patterns are never applied in practice in a pure format, pretty much just like the classic design patterns from the GOF. This is a weak example from OP.
- raducu 5y agoMVC is older than 3 tier applications and saying "model=database" makes me cringe and squirm, but at least I know they do a lot of CRUDs :)
- shusaku 5y agoThe article really rubbed me the wrong way. It feels like the writer was insanely judge mental of interviewer, immediately thinking that he was so much smarter than the guy that he was afraid to embarrass his future boss. All this confirmed by a brief moment if body language? Give me a break.
- koonsolo 5y agoI do not think I am smarter than anyone else. It's just that some things you know better and other things you don't. I worked with the team lead for several months, and really enjoyed it. He was smart and a very good team lead. Sorry if my article gave you a wrong vibe.
- hitekker 5y agoI think you're fine. The GP is just threatened by your everyday social intelligence. It's not that you're superior to him, it's that he feels inferior or lacking compared to you.
- D13Fd 5y agoAgreed. I think the better and less risky way to handle this situation is something like: "There are two views on this. Some people say x, but I would argue that the better view is y." Giving the wrong answer intentionally is both dishonest - never a quality I would want to have, especially in an interview - and liable to backfire.
- koonsolo 5y agoAs far as I can remember now, I was also not 100% sure about my answer, because I did need to look it up later to confirm that I was right. So maybe I just took the easy road and answered what I knew they wanted to hear.
- jimmaswell 5y agoMVC always seemed totally arbitrary and impractical to me.