MVC (Model-View-Controller) is a software architecture pattern that enforces separation of concerns.

learn more… | top users | synonyms

1
vote
0answers
44 views

MVC with Post/Redirect/Get

I have a question in mind for the MVC pattern for a long time now. When using the Post/Redirect/Get principle then it doesn't make sense to use ONE model in the sense of MVC, right? Why should I ...
-2
votes
0answers
29 views

.NET MVC Razor with forums [on hold]

I am looking for a forum to add to my site. My site is being developed in .NET with C# MVC Razor. My goal is to use the forums, but importantly, use the underlying functionality to build my user ...
0
votes
1answer
48 views

Where to put utility classes in php mvc?

I'm working on my first MVC website, where can I put utility classes like Security and Date (my native date) classes, are they model too? App | |--- Model |--- Controller |--- View
-5
votes
0answers
36 views

how to insert a column values dynamically [closed]

How to pass an array to SQL SERVER 2008 stored procedure and insert all the values of a array into a database table. For Example: From ASP.NET mvc C#, I would pass a parameter having multiple values ...
1
vote
0answers
29 views

Encapsulating business logic that goes beyond validations in MVC

I'm pretty clear business logic goes into Models. But on this question, they refer to business logic as pretty much low level validation (if the user signs up, ask for their e-mail). What about ...
1
vote
1answer
36 views

PHP MVC Model with a method to fetch all of the model from database

I have a crazy question, consider I'm developing a blog website, There is two model named Post and Comment, now I wanna add a method to fetch all comments from database, which model should I choose to ...
1
vote
2answers
110 views

Sharing code logic between controllers, through the Model layer?

As I originally conceived my Model layer, it was only supposed to hold data and no code. I receive DTOs from web-services, they are mapped into my Model objects. Those model objects usually end up ...
0
votes
1answer
47 views

Where is asp mvc model data stored?

I am using ViewModel classes in order to structure data being populated inside of a controller. My questions is now where exactly is data of a @model stored after being populated via asp mvc ...
1
vote
1answer
30 views

Proper MVC practice for a hierarchy of elements

I am trying to develop my first major MVC application, and as such I am new to doing this on a large scale. I've read as much as I can online and am continuously striving for making my code as clean ...
0
votes
0answers
32 views

what is the best method to return db query and additional information from other methods

I am new to MVC and trying to continue to learn base on best practices. I am trying to return data from multiple sources -- one source being a mysql db query and another source from another method ...
0
votes
0answers
22 views

Architecture: Validate polymorphic votes - Controller or Model?

I have a question because I don't want to do something wrong. I have a polymorphic relation called votes. Well, I want to save votes but I need to validate if a user already has voted. But even if, ...
1
vote
4answers
54 views

When to use controllers in mvc

I am studying mvc5 in asp.net and wondering if there is a general rule when to use a controller. If I have a business object like Employee will I create a controller named Employeecontroller? But why ...
1
vote
3answers
137 views

Controller in MVC

Alright so it is an essential part of OOP that one class should only do one thing, and it makes sense. In practice I've seen that classes which don't obey this rule get thick and cluttered. So I was ...
2
votes
2answers
111 views

MVC: How dumb should the view be?

creating an MVC structure and pondering this... My view has an Add button. Click it and we send off a request to the controller (using pub/sub so view doesn't really know who its talking to). Having ...
2
votes
2answers
125 views

Why is the Document Object Model the view?

I was told by a Javascript programmer not to do DOM manipulation in model code. I also remember hearing a snazzy tune for a JS framework (I forget which one): "Get your models out of the DOM". This ...
1
vote
1answer
135 views

Does snapshot change tracking break DDD principles?

I'm building a website with MVC 5 and Entity Framework 6, implementing the Unit of Work & Repository patterns, and - for flexibility and performance - would like to utilize Entity Framework's ...
1
vote
1answer
68 views

PHP MVC Display many records - model logic

I bet this question has been asked already but I can't form my thought as you can see from the title, so I couldn't find anything. I am working with MVC for quite some time now and I'm pretty happy to ...
1
vote
0answers
49 views

Java MVC: multiple use of the same event for different actions

I am working on a large Java project which employs the model-view-controller pattern. Should I use a different event for each action (to let the views communicate with their respective controllers)? ...
1
vote
1answer
141 views

MVC URL structure with URI parameters

When creating routes for your MVC web application I have seen two possible ways to pass variables to a controller method: With the first approach the variable is passed to a parameter of the ...
0
votes
2answers
192 views

Model-View-Controller: who creates whom?

In "Pattern Oriented Software Architecture - Vol 1" (p. 131), the author said that View is responsible for creating Controller. But in "Head First Design Patterns" (p. 562) it is the Controller that ...
1
vote
1answer
28 views

Best way to keep consistent data in model across devices?

I have a model for an app that is fairly large, all of which needs to be on a users' device at the same time. For example, a spreadsheet. If a user makes a change to the model on one device, I want ...
2
votes
2answers
130 views

Should I use a large if statement inside a view or create a different view entirely?

I'm using the MVC architecture Laravel 4.2 to create a relatively complex web application. This application consists of a website which is very heavily based on whether an event has occurred or will ...
-1
votes
1answer
46 views

Know any good resources/information on architecting an iOS app? [closed]

I spent a few months working on an iOS app of mine (in Swift) before realizing it was really a bunch of MVCs (Massive View Controllers). I want to start fresh and build something modular, scalable, ...
1
vote
1answer
55 views

Doing the same thing from different views

I have an MVC app, which has multiple views that give overviews (from different angles) on items. For now, let's just call these views View1 View2 ... ViewX They all use the same Model Collection ...
2
votes
2answers
257 views

What is the best way to create REST API error response model and error codes system?

My REST implementation will return errors in JSON with next structure: { "http_response":400, "dev_message":"There is a problem", "message_for_user":"Bad request", ...
1
vote
1answer
132 views

Adding a graphical view to a system

I currently have an program in Java that simulates railway movements. Essentially, trains arrive on platforms, pick up and drop off passengers, and then proceed, respecting signalling where possible. ...
29
votes
9answers
5k views

Explain MVC to non-programmers [closed]

I have a need to explain MVC to non-programmers. Namely, to managers of other departments, in the context of progress report. One of the things I do is refactor our codebase towards MVC separation. ...
1
vote
1answer
133 views

Does key-value observing between model and view violate MVC?

In MVC the Controller is the go-between for the View and the Model. So the Controller should be the one that observes or receives changes from the Model and View and updates the other accordingly. I ...
0
votes
0answers
99 views

Best approach to save relationship mapping of country,state,city in orm

I am building a project in play framework java with jpa and I want set country,state,city dropdown fields in a form to be dynamic(from database).So only admin can increase or decrease the value of ...
0
votes
1answer
54 views

MVC: Inserting a view from a SubController to its Parent controller

I have 2 controllers: 1 top level controller,MainController, and a SubController, which MainController has an instance of and controls. The SubController has a Subview which goes inside the MainView ...
9
votes
2answers
330 views

Massive View Controller - IOS - Solutions

I'm sure every new iOS developer has the following problem: The View Controllers get very fast crowded with code for various purposes, easily getting to 500 + lines of code. This is how it looks like ...
2
votes
1answer
109 views

Ideas on Model of simple Traffic Simulation [closed]

I want to write a simple traffic simulation with one road intersection. First I thought of a cellular automata in the model but it should not be limited by an underlying discrete grid system so the ...
1
vote
1answer
446 views

Strongly typed views, ViewModel and MVC

I'm learning MVC and the book I'm using favors strongly-typed views. Some of these concepts are new to me and I'm trying to better understand the design philosophy. Strongly typed views typically ...
-1
votes
1answer
97 views

Approaches for manage AD users inside my HR system [closed]

I want to start a new HR web application based on asp.net mvc-5 & Entity Framework. as it is almost the case Users inside the HR system will exists inside the AD, and when a new user join our ...
0
votes
2answers
166 views

Develop GUI and logic in a team the right way? [closed]

I am planning to start a small project with a friend. I will be developing the GUI using JavaFX in the MVC pattern and he will be responsible for the model/logic. My question is: how can we achieve a ...
0
votes
2answers
91 views

REST backend restricted access only for humans

I will design a REST backend that will work with my database. I want users to access this data by viewing my webpage (I will work with an MVC JS framework) without logging in. At the same time, I ...
2
votes
2answers
302 views

PHP MVC as backend for iOS app

So, essentially, the question is, to develop a PHP back-end to an iOS application, would you implement an MVC architecture on the PHP side? Or no, since the client side (iOS) already has an MVC ...
6
votes
1answer
223 views

In MVC should a model contain subview models?

Some background: A colleague and myself have different interpretations of MVC which means, given the same problem, we are coming up with radically different solutions. He comes from a Java background ...
1
vote
3answers
240 views

Building a calculator using MVC

I've been programming in Java for about 6 months, and I thought a good and challenging test of my skills would be to build a GUI calculator. I have very recently heard about this MVC idea, and I ...
1
vote
1answer
97 views

Is a good practice to call a Controller function from another Controller?

I'm having a case where I'm handling the logic of a search in one controller and I'm generating some data based on searches and returning as statistics. Is a good practice calling a controller ...
0
votes
0answers
36 views

How can I structure my angular app so that I don't end up with one huge controller and view?

I have an angular app that concentrates most of its functionality around a primary entity that has several satellite entities. The UI for this is effectively one screen, with a few tabs, one for each ...
0
votes
0answers
137 views

Usage of MVVM in iOS

I'm an iOS developer and I'm guilty of having Massive View Controllers in my projects so I've been searching for a better way to structure my projects and came across the MVVM (Model-View-ViewModel) ...
1
vote
1answer
134 views

How to avoid switches? [duplicate]

I use Laravel as a PHP framework, although the question is not exactly about laravel, more about structuring controller methods. I have a route to orders page. Depending on the user role I need to ...
2
votes
1answer
75 views

Proper MVC design and helper classes

I've been reading into Model-View-Controller and was wondering where something like a XyzClient class would fit into this design. Splitting up MVC is easy when all you have are some views to display, ...
0
votes
0answers
79 views

MVC Sites and Entity Framework (using DbContext)

I've been looking at a couple of the MVC tutorials on the ASP.NET website and and have noticed numerous of them make use of Entity Framework (especially the Identity provider stuff). Maybe my ...
2
votes
0answers
123 views

How to pass control between sub-controller to parent controller in Java MVC Design Pattern?

I'm pretty new in Java, but I've done plenty of research and I know what MVC is. However, to implement MVC in Java was a difficult task. I followed this tutorial, which helped me to realise that the ...
0
votes
1answer
115 views

How do different technologies connect to form a web stack? [closed]

I am a little confused, is it possible to implement a front end using common languages like html, css and javascript and then do server side processing using a language of your choice, say python or ...
4
votes
3answers
122 views

Should access logic go in controllers?

I want to know if all the logic related to permissions and access control belongs to controllers (Application logic) or models (Business logic). Currently I have a controller that does something like ...
5
votes
2answers
107 views

In an MVC, should models use libraries, or should libraries use models?

When I build a RESTful API, I use an MVC pattern. And in order to make controllers skinny and code reusable outside of the API (e.g. in Cron tasks), I put much of my code into services (commonly known ...
3
votes
1answer
241 views

Web Forms and MVC in the same web project

I'm working in a large legacy project which was build with ASP.NET Web Forms and the idea to add in the MVC libraries to the same project has been tossed around. I know that this is possible (there ...