View Full Version : In a MVC pattern, where should the listeners be?
paswicka
07-14-2011, 05:08 PM
I got asked an interesting question in an interview the other day, and am not sure what the best response should be. The question was "In a MVC pattern, where should the listeners be?". This was asked with the PureMVC framework in mind. I'm sure it was one of those questions that had more of a thoughtful answer than just one place, but I said "In the Controller" since it handles most of the communication between the views and the models through listeners. Afterwards I thought to myself that there are listeners in the views with UI events such as button clicks, drag & drop, etc, and there are listeners in the model such as when data changes.
So my real question is how would you answer it?
Barna Biro
07-14-2011, 06:16 PM
I would have firstly and simply asked: "To what listeners are you referring to?" You should have a clear question in order to attempt to provide a correct answer... Don't rush into providing fast answers all the time. Sometimes, the interviewee might actually be interested in testing "your other skills", mostly by putting tricky / ambiguous questions and seeing if you ask for clarifications in order to clearly understand the problem and try to provide a correct solution afterward, or you simply take the risk of rushing with an answer ( may that answer even be correct in certain situations... but maybe false in a different one; I believe that "asking for clarification is not something shameful" especially when the description / requirement is clearly cryptic... it's a lot better to ask questions and get a clear picture of the requirements, than jump directly into programming, waste a lot of development time and realize quite late that you were on a wrong track all that time ).
wvxvw
07-20-2011, 11:18 AM
Yep, me too, remembered Hasek and his famous book where the to-be-soldier Sveik is being asked some silly quiestion to verify his suitfulness for the Austrian army., Where, instead of giving a concrete answer he mimics the interviewer and asks him back something like "how old is the landlady if it is known that the light is lit only in 2 windows of the third floor at some bizarre street in Prague..." Sorry, couldn't find the quote.
That is the question is rather bizarre, I wouldn't be able to find any sane answer to it.
paswicka
07-25-2011, 04:06 PM
I'm sure it was a question to generate more of a discussion rather than a straight up answer. Unfortunately it threw me off more than it made me think... too bad I didn't recognize that. Something to look for next time I guess.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.