Tag Info

Hot answers tagged

11

It is best to start with your model. Your controllers will be based on your model, and then you make the views to access the controllers. UI/View logic should always be the last thing you work on, as it can change as the data changes, but if you design your model first, you are working using a bottom-up approach, so by the time you reach your view, you'll ...


10

The user interacts with the View, but the View must communicate the actions to the Controller. The Controller may update the Model, but it isn't required with every/any change. The description I am providing is based on my personal experience with the .NET implementation of MVC. Your implementation can be different. The Controller is where actions are ...


6

Try looking for MVVM instead of MVC. Here's an MS article on MVVM which is very much applicable to WPF And here's another tutorial on MVVM with WPF Or look at MVP with winforms. From a broad point of view, MVVM and MVP are just variants of MVC.


3

The pattern you describe is what I know as MVP, Model View Presenter. This is an alternative to the MVC in that the Presenter contains the logic for updating the UI code without the View requesting the data from the Model. The traditional MVC pattern does indeed allow for the View to know of the Model. When to favor one over the other? Purists will ...


3

The whole idea of MVC is Separation of Concern and by introducing any method that builds/generates any form of mark-up like what you are doing in your example, even without directly outputting them, you're violating that. So this is not MVC anymore. In your example changing the desing/mark-up by a designer needs modification in your object.php by a ...


3

The user interacts with the Controller. From the technical point-of-view you're not interacting with the View, you're just using it to interact with the Controller. On the surface it seems that the user is interacting with the GUI -- also to a non-programmer this makes more sense, however by clicking on a button you're basically talking to the Controller ...


2

A bit of an outsider comment/answer, I'm not a .NET MVC programmer but have done a lot of PHP, Java, and AS3 programming and relatively recently switched to AngularJS as well. My general feeling is that the back end should just be RESTful and shouldn't touch the front-end really and the front-end should only depend on the back end for data. There are some ...


2

I'm not sure what to tell you based on what you're asking. Is the definition for the MVC pattern one of these terms that are interpreted in a variety of ways, which are all acceptable? Well, yes. I mean, every concept has a history, right? So back in the late 80s, Smalltalk developers coined the term "MVC", and it had many of the features you expect -- a ...


2

You need to look at these sub-objects and what logic they contain. Something has to decide how to mark up the text. As your question makes clear, the controller should not (and in your case, is not) the place where this occurs. Those sub-objects may be considered part of the view, in that they contain code responsible for assembling the dynamic parts of ...


1

Generally all nouns should have their own class, a model in the case of using the mvc pattern. User and order are two separate things so you should have two models. However, they are related so your data model should have a key or bridge table to relate users with orders. A user has orders but a user is not updated from an order but more precisely an order ...


1

The practice of "outside-in" test-driven development recommends coding the UI first, driven by tests in which you stub out the back end. You continue working down the layers of your application like this, testing (and coding) each layer of the onion until you are ready to move inwards; the model is typically the last thing you write. This has advantages and ...


1

You want to use the DependencyResolver Class. http://msdn.microsoft.com/en-us/library/system.web.mvc.dependencyresolver(v=vs.118).aspx In your global asax, you set the resolver and wire up fake implementations of interfaces that your data access layer also implments Then in your controller, you create 2 constructors public Controller() : ...


1

I would discard any MVC concepts and focus on what the interface means to you. From what little I know, IComplexActivity is a start. If there are no possible conflicts, you could reduce this to IActivity. That might be inviting trouble. IApplicationActivity makes it less general. You might consider smaller, composable interfaces as well. Golang favors ...


1

I think your question is not answerable at all, and you will ended up getting all again different opinion-based answers. You can't basically compare a definition that you're not actually sharing it with us -- I might have a different understanding of MVC, with all the known/unknown implementations. People usually do Experiment with what they have. That ...


1

Let's use a concrete example of why users interact directly with views and not controllers. In the music app on the iPhone, a high level feature is to play a playlist. "Play a playlist" is a function of a controller to the app. There is more than one way to activate that function. I can click on the playlist inside of the app, or I can ask Siri (voice ...


1

Presumably the pullFrequency parameter is used client-side to set up the polling; if you're happy to restrict yourself to browsers that support HTML5 then the cleanest solution may be to have a sensible default in your page and if the user wants to update it, pop it in Local Storage ( see http://diveintohtml5.info/storage.html ). That way your main ...


1

You can certainly use any mix of client-side rendering and server-side rendering, but I would recommend against trying to mix ASP.NET MVC helpers with AngularJS directives. It might seem like a good idea at first because you're already used to using those helpers and you don't have to write "raw html", but they defeat the some of the purpose of what ...


1

I am building an app that is a combination of MVC on the server and AngularJS on the client. On the server: I found the easiest thing to do was to build a bunch of RESTful web api's to provide data services to the client. I also perform validation on the server to make sure that no one cheats (sending data using a client other than the web page). I also ...



Only top voted, non community-wiki answers of a minimum length are eligible