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

learn more… | top users | synonyms

0
votes
3answers
220 views

MVC pattern synchronisation

I am facing a problem in synchronizing my model and view threads I have a view which is table. In it, user can select a few rows. I update the view as soon as the user clicks on any row since I don't ...
27
votes
7answers
2k views

Is it possible for business logic not to creep into the view?

I've developed for several web application projects for the last 3 years, both personal and at work, and I can't seem to figure out whether it's possible for at least some business logic not ending up ...
0
votes
2answers
134 views

Is it good style to store view data inside the model?

I'm using a variant of the MVC pattern. In my GUI code, often the need arises to synchronize "view data" (e.g., selected item) between different views. For example, let's imagine a vector drawing ...
2
votes
0answers
165 views

MVC 5 - Best practice for handling dates inside and outside the USA

I have an MVC 5 application that will be used world wide. A number of the pages in the app will require users to enter dates. I'll be using the jQuery datetimepicker plug-in to allow the user to ...
7
votes
3answers
666 views

How exactly to use the MVC design pattern

I have read the documentation on the apple's developer website which refer following guidelines A view class shouldn't depend on a model class (although this may be unavoidable with some custom ...
0
votes
1answer
134 views

MVC: Where should I store interchangeable algorithms used by the Model (whose names also need to be accessible to the View)?

Please consider a program, where the user chooses an algorithm from a list, and the Strategy pattern is utilized to set this algorithm as the model's operation. For example, an image procession ...
6
votes
2answers
482 views

MVC: my controller seems useless half of the time. Is this a problem?

Often when I design a program with MVC, the controller is useless half of the time. What I mean is this: something happens on the view (e.g. a button click). The view then notifies the controller. ...
8
votes
2answers
516 views

Javascript MVC application design (canvas)

I'm having difficulty grasping how to structure/architect a canvas application using an MVC like approach in Javascript. UI will be fairly fluid and animated, the games fairly simplistic but with ...
0
votes
2answers
92 views

Controller and Model Interaction

I'm fairly new to MVC and I'm trying to get a better understanding of it. There is endless information about the theory and general responsibilities of each part of an MVC app, which I've read a good ...
0
votes
0answers
69 views

How to implement 'use case control' object in (iOS) MVC?

In an MVC architecture pattern (for e.g., in iOS) there is a controller per view. In UML there is a concept of having Control object per use case to encapsulate an use case, which may span more than ...
0
votes
1answer
41 views

Using different DB Connections for different user groups in a web framework

Database designers building enterprise systems usually assign different sets of privileges to different users of DBMS. They can be as granular as needed. However, in my experience, web frameworks ...
5
votes
4answers
750 views

MVC: Does the Controller break the Single Responsibility Principle?

The Single Responsibility Principle states that "a class should have one reason the change". In the MVC pattern, the Controller's job is to mediate between the View and the Model. It offers an ...
2
votes
2answers
148 views

MVC: Controller often simply delegates to Model when notified by View of GUI events. Is this reasonable?

Since I learnt about MVC, I used it for every app I made (which is arguably not the best idea, but that's not the topic of this question). All of them small, 1000 LoC apps. I am using Java and Swing ...
4
votes
1answer
204 views

Use model for “everything” in MVC?

This question is a result out of the discussion HERE and was moved from HERE. Is it really good practice to supply EVERY value you display in any view via a model? Especially variables like the ...
0
votes
1answer
40 views

Multiple models or a single model with multiple custom data types?

I am writting a small webapp for learning. Is it better / best practice to create multiple models or one model with multiple custom data types? For example: Let's say the web app is "PublicLibrary." ...
0
votes
6answers
3k views

Combining two MVC frameworks in a project

Is it any good to combine two MVC frameworks together in a project? Is it a fairly common approach? I am thinking about using a serverside framework like CodeIgniter/Laravel and client side framework ...
0
votes
0answers
55 views

URL and Controller structure for parent-child-relationship

I use an MVC web framework to create an application which contains a hierarchy: Location <1-N> Devices <N-M> Services I have a number of Locations. Each Locations can have several ...
0
votes
0answers
55 views

Specific class to pass a bundle of data from my Model to Controller or a simple Collection?

I am doing an Invoice application implementing MVC pattern design in Java. One of the features my application has to have is showing all info about a Customer: Personal data, Calls, Invoices, ...
2
votes
2answers
258 views

MVC: “User” model gets big and crowded. Should methods that do CRUD operations on one-to-many relationship data be in different models?

In most MVC web projects there is a User class. Many times a user has something else in a one-to-many relationship, i.e. orders. If we have a user class that has many orders, should methods that add, ...
1
vote
4answers
4k views

asp.net mvc vs angular.js model binding

So I've noticed a trend lately of .net web developers using angular.js on the client side of applications and I've become more curious as I play around with angular and compare it to how I would do ...
3
votes
2answers
185 views

Which do you code first, MVC? [closed]

I have been coding for a good bit, and I found a project I want to work on -- a python web app using django + mongodb. I know what I want my web app to do. When you are in this circumstance (just ...
1
vote
1answer
198 views

Why no MVC methodology for desktop applications? [closed]

I'm currently learning how to develop web apps with C#, ASP, .NET and MVC. I am enjoying the MVC paradigm a lot, but then thought about using this to develop desktop software with. I googled around, ...
0
votes
1answer
122 views

Design MVC site such that UI developer can work without access to data tier? [closed]

I'm working on an ASP.NET MVC site (using Team Foundation Service for source control) that I've divided into a few separate projects under one solution: Project.WebAPI (Main entrypoint, contains ...
1
vote
2answers
266 views

Is it wrong to have HTML strings within PHP objects, or is it only wrong in controllers?

I've always thought that in typical MVC design it is bad practice to build & concatenate HTML strings in any PHP file or class that isn't strictly a template. I'm working on a large project with ...
0
votes
1answer
176 views

MVC in a desktop application - can the View ever hold a reference to the Model?

(I'm specifying this is a desktop application so people wouldn't refer specifically to web implementations of MVC). The title says it all pretty much. In an MVC structure - can the View ever hold a ...
0
votes
0answers
94 views

How should I populate a list of database-sourced models?

I have a model which sources its data from a MySQL database using a load() public method. If I have a collection of models, I have to loop through each model and call its load() method individually; ...
0
votes
3answers
130 views

Can MVC implementations differ in design-details and still be considered MVC implementations?

Is the Model-View-Controller pattern very strictly defined, to it's design details? Or is it a term, like many others, with lots of different interpretations and versions (that all fit the ...
4
votes
3answers
829 views

Model-View-Controller: Does the user interact with the View or with the Controller? [closed]

I have recently learned about the MVC design pattern. I'm learning from the Head First Design Pattern book. According to this book (if I understand correctly): The Model is most of the application ...
0
votes
1answer
178 views

Is it fine to skip MVC?

I am building a pair of components that communicates in a one-way fashion: [ JButton ] --> data...process...process...out --> [ JTextField ] The JButton allows the user to select a file and ...
0
votes
1answer
32 views

Pull Frequency Parameters in MVC architecture

Assume a simple SPA (Single-page application), maybe a dashboard and these basic conditions: The Model contains methods for accessing and displaying data; The View contains methods to load ...
1
vote
1answer
289 views

MVC & 3 tier architecture in game - What is the business layer

I am making a game and have been following examples which use the MVC architecture pattern. I am now trying to get my head around how this would fit in with a 3-tier architecture. From what I have ...
-1
votes
1answer
199 views

Building a webservice with mvc [closed]

I'am planning my website over here based on MVC. And I am thinking about a webservice (who knows, maybe one day I'll create an android app or something). The site and the webservice will behave ...
1
vote
0answers
104 views

Run a function when a function in a list is executed?

Goal: I'm currently doing an MVC project and I have this method to update the ViewBag (based on previous actions of the user). I would like to call this function whenever a certain list of MVC Actions ...
6
votes
5answers
7k views

Server side C# MVC with AngularJS [duplicate]

I like using .NET MVC and have used it quite a bit in the past. I have also built SPA's using AngularJS with no page loads other than the initial one. I think I want to use a blend of the two in ...
0
votes
1answer
69 views

What is the best way to keep both html document structure and php control structure strongly visible in complex view file

I create a lot of views in my work as part of the common MVC pattern applied in web frameworks like Code Igniter and Cake. I also adhere to the following maxim as best I can: fat models and library ...
0
votes
1answer
266 views

MVC: How to Implement Linked Views?

I'm developing a java application to visualize time series. I need (at least) three linked views, meaning that interaction with one of them updates the others. The views are: A list represents the ...
2
votes
1answer
1k views

Is there a best practice for populating a dropdown in ASP.Net MVC? [closed]

I'm coming into a project where the overlying method is to open the page, then use jquery AJAX calls to populate all of the dropdowns dynamically in the page. To me, this seems like an extra burden ...
0
votes
2answers
76 views

Why additional code and complexity when data model and interaction are simple is considered a disadvantage in MVC model

According to the slides given by my lecturer, one of the disadvantages of MVC model is additional code and complexity when data model and interaction are simple Why is this so, I would assume ...
1
vote
1answer
156 views

Web design pattern

I am building a small website, in PHP and I am using MVC design pattern for the UI. In the future I will need to add mobile support for my website. It will be in the sub domain "m" like everyone. All ...
2
votes
2answers
2k views

Domain Model vs View Model

I'm in the early stages of my programming career and I've been working with MVC for just about a year now. I've spent much time learning about the pattern and the concepts behind it, but as the ...
1
vote
3answers
281 views

MVC: What is the difference between a model and a service?

Why in some frameworks the logic layer is called "Model" whereas in some it is called "Service". Are they different from each other or just different by naming conventions? UPDATE 1 The reason I'm ...
3
votes
2answers
385 views

Help With Dependency Injection

I am still very confused as to why and when to use Dependency Injection. If anyone could explain maybe using the below example that would be great, any other explanations would be appreciated. Lets ...
-2
votes
1answer
160 views

Best practices in Application's flow diagram [closed]

I make web applications, mostly MVC, object oriented and database enabled. I always have trouble going back to project after a few months of release and work again. I don't even remember what I made ...
1
vote
2answers
272 views

Good Programming Practice for similar child classes

I am developing an iOS application, in which I have to draw some patterns on a view based on option selected by user. Let me explain you more clearly. User will be shown number of images as options ...
4
votes
1answer
216 views

Designing storage service data structure for decoupled models sharing same data

Surely most of you remember the Norton Commander application where similar (sometimes the same) data is displayed in separate decoupled views. I'm building a web application that follows the same ...
2
votes
2answers
126 views

Handling login errors with User Class

We have a User class which handles all things related to users within a Content Management System. As you'd expect, the class contains a function login(). This function accepts three arguments: ...
1
vote
1answer
128 views

Need help modelling a User/Project/Task relationship

So I'm creating a very simple project/task management application in Laravel 4 and I'm not sure how these relationships would work. I have a Project, Task and User model. A User can own a Project or ...
2
votes
3answers
204 views

How to properly distinguish between MVC and three-tier?

Many webapp frameworks, e.g. Spring,call themselves MVC frameworks, but how is the distinction done between MVC and three-tier? It seems that some frameworks call themselves MVC frameworks but they ...
0
votes
1answer
131 views

MVC Widget optimization when accessing CSS and Resources

So we're trying to re-imagine our web solution in an MVC fashion. Going from an old webforms based solution to working with ASP.NET MVC with a bootstrap main menu and adding functionality in the forms ...
0
votes
1answer
222 views

Practical Use of Depency Injection (IoC) Container

I am creating a MVC-ish framework in PHP. I am trying to implement a DI Container to allow the creation of controller objects (among others). My MVC framework is pretty typical. Each module (or ...