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

learn more… | top users | synonyms

4
votes
2answers
71 views

Multiple controllers for same resource based on user's Role

I'm having trouble designing this role (or permission) based application, when it comes to figuring out how to handle actions that differ per use role. For instance, our controller is ...
2
votes
4answers
113 views

Can someone give me a good definition of the term “business logic”? [duplicate]

I kind of get what it means, but not enough to explain it by myself. Is a key concept when talking about the MVC pattern and it's giving me problems to explain that concept too.
1
vote
1answer
22 views

MVC Set or Read View Components

I often see the follwing example when reading about MVC (example is in Java, but question adapts to all OOP languages): class View{ JTextField tfName; public String getTfNameText(){ ...
-1
votes
1answer
121 views

PHP: where to call helper class in MVC?

I've a helper class in Laravel 5.1 with static methods for calculating week numbers, dates in weeks, etc. (Why static? I need max. 1 instance of this helper class) I need this logic in my views. I'm ...
2
votes
1answer
160 views

Business logic in the models?

I use the repository pattern for data handling. In my DAL folder i have IUserRepository, UserRepository and UserContext. Inside the models folder i have a class called User like id, username etc. I ...
0
votes
1answer
125 views

Is it always better to use __construct() in CodeIgniter's Models and Views, even if it's not needed? [closed]

Sometimes we have Models and Controllers where the function __construct() just doesn't do anything, but is sitting on the top of all the methods in CodeIgniter's models and controllers. A lot of ...
0
votes
1answer
133 views

Webdesign MVC - going in the right direction?

I am trying to learn webdesign using the MVC design pattern. Right now, I am stuck at a point where my code gets more complex, and I am unsure about the structure and where to put which code parts. I ...
12
votes
1answer
309 views

Can domain models in the database be a sustainable solution?

I just started at a new job as a database developer for a medium-small sized, company based on Microsoft-technology. I noticed early on how much practices deviate from what I've been taught at school ...
1
vote
1answer
31 views

Configuration Files For Web Applications

I am building a MVC application. This app has a core which is where all interfaces, abstract classes and operation logic are situated. It also contains a directory called module, this application is ...
1
vote
2answers
160 views

A proper way to work with MVC

I got into a debate at work today, I hope you can help me to settle it up. My colleague wants to separate UI, Model, DB, and Network like so: Create an API level between UI and controller, that ...
2
votes
3answers
263 views

CRUD operations in DDD

I'm designing an application with DDD. I'm moving from flat POCO objects to strong domain models, so my question is: Would I have to call my basic CRUD operations (located in my repository layer) ...
0
votes
1answer
37 views

Confusion over organization of services

I have the following services: UserServices This has various methods: fetch_by_id(), create() etc. SessionServices Session handling: create(), destroy(), various getters. AnswerServices An answer ...
2
votes
1answer
39 views

In MVC framework, where do we define how data are displayed?

I think that the controller should bring the data to view from model. However, is it controller's duty to tell how view should display the data, or the view should know how the data should be ...
4
votes
2answers
393 views

What is NOT MVC? (in a web app)

It is easy to find many descriptions of what MVC is - for instance here, here or in this video. I'm curious, what is NOT MVC? or more precisely - In a MVC-using app, what is everything else apart ...
1
vote
1answer
83 views

Where to put common business logic in DDD with MVC

Providing I have the following scenario: I have a Web application where users can deposit money to their accounts (wire transfer). When a user deposits money to their account, they should click the ...
1
vote
1answer
116 views

The Model or the Controller write data on the view in MVC and what is the use of the Model if we have data in Store?

I've read several articles, watched videos and read questions on here, but the more I read and learn about MVC - including MVCS or MVP in addition.. to make it even worse - the broader the pattern ...
0
votes
0answers
31 views

What happens to super handler with instance variables

What will happen if I extend a class A to a controller B, when A has instance variables (private, protected)? I have a main controller MY_Controller(handler) which has several methods: can_modify ...
2
votes
1answer
288 views

Model-View-Controller design question (One vs. multiple models for multiple view+controller)

I have an issue with shared code in a MVC application. Application controllers/views ABC are different classes but use a common framework. It is a single class reused multiple times. Let me introduce ...
0
votes
0answers
36 views

MVC single view file with multiple uses depending on passed in value

I'm using Laravel with Blade to build a simple maintenance application for my work. One of the functions of the application is to display simple statistics for a piece of machinery. To keep things ...
2
votes
2answers
246 views

What is the role of the public folder in MVC web applications? [closed]

Must all the controllers, models and views be placed in the private folders? If so, what are the roles of the public folder? What are the correct terminologies for such roles in computer science? How ...
1
vote
3answers
167 views

Should I create a class for functions that uses of the database?

I have a PHP application which is pretty simple: It allows the user to create, edit and read a post. Basic stuff. I have a Database class which handles the connection and the queries execution. The ...
0
votes
1answer
84 views

Simple explanation of MVC needed [duplicate]

I am trying to understand MVC, but for most of the Q&A's I have seen, the description is great but I cannot quite understand it, I think it works like this scenario I thought of: User ...
0
votes
0answers
242 views

Structured JavaScript Codes

A while ago I started working on a web application which has a lot of JavaScript code due to having a lot of client-side logic. Before starting, I had had a quick look at a couple of JavaScript ...
2
votes
3answers
155 views

How does the usage of MVC in web development fundamentally differ from the original usage of the pattern? [closed]

I recently read an answer regarding MVC and web development, mostly about how it was originally designed for older systems and has since been applied poorly in web development. That being said, I'm ...
0
votes
0answers
24 views

What is preferred in an MVC framework, having each string defined as a variable in the Controller or generating them in the Template?

In a clear separation of the MVC layers, having each variable in the view seems to be the right way, but in practice in can be more "natural" (at least for me) to put them in the template. for ...
0
votes
1answer
79 views

Dynamic query from view layer

In my current job they are defining a new corporate architecture for java development. It is something like this: ProjectView: JSF view layer. Uses delegates on the ProjectClient layer. ...
2
votes
3answers
757 views

Multi user website for MVC project: one, or multiple solutions?

We're starting a new MVC 5 project that will ultimately consist of 4 websites depending on the kind of user: One internal, for company employees. One for agents, independent contractors that work ...
1
vote
1answer
316 views

Array vs Object for View in Laravel

First, yes This question is very similar to Arrays vs Objects in view template but my question sort of expands on this... When deciding on whether to use an object or array to pass data to your view. ...
3
votes
1answer
104 views

Could a view call a function of the model directly?

this is a fundamental question about MVC (in particular using AngularJS) and I've found similar questions here, but not the exact same problem: Could the view call a function of the model, or should ...
1
vote
1answer
139 views

Organizing action in MVC controller

I am developing an ASP.NET MVC application, that has a lot of client side interaction ie. a lot of ajax calls to controller actions. Currently I have controllers containing actions (part of the same ...
7
votes
1answer
306 views

Never using Models, only ViewModels

I'm starting a new MVC 5 project from scratch. I'm using EF 6 (Database First) and Identity 2.0. My solution consists of 3 different projects: Data (where I have a .edmx and my DB context), Resources ...
1
vote
0answers
45 views

Server responding with UI logic, String representations of data as string over flags

I think there isn't a large enough degree of separation between Business Logic, Data and Presentation in some of our products. I'm trying to explain this to collegues but I'm finding it difficult as I ...
10
votes
5answers
484 views

Should the View not perform validation?

I was reading "In MVC should a model handle validation?" because I was curious about where validation logic should go in an MVC website. One line in the top answer goes like this: "controllers should ...
3
votes
2answers
158 views

Designing my classes with relationships

I need to build a UI for entering values to the database. I am stuck with my class design to achieve it. I need a UI where I am able to enter the name of the system. Each system can have many ...
1
vote
1answer
61 views

MVC .NET APP Program Structure [closed]

I am just building a MVC .NET application, eventually this will use entity framework and the repository pattern to structure the program. The first release however will only be calling other jobs that ...
2
votes
2answers
349 views

MVC controller and decoupling explained

In this article you can see that View has (uses or aggregates ) controller and ConcreteView has Concrete model. public abstract class View { public abstract void Update(); private ...
4
votes
1answer
148 views

MVP / MVC role of the Model (not anemic one) clashes with presenter / controller role (responsibilities in the right place, Model OR Presenter)?

Problem? I have been looking at MVP implementation and process to design a good domain model (not anemic). It says that the domain model should have its own behavior and not being a simple data model ...
1
vote
1answer
137 views

iOS Best practice for handling model objects

There are different levels I'm asking this question at. Case 1: Let's think about the typical drill-down design. Say a table view controller has an array of custom objects, and tapping a cell will ...
2
votes
2answers
56 views

Refactor presentation logic from model

I've seen this pattern used in a considerable amount of MVC applications. Let's assume we have a User model with the methods: hasSessionExpired displaySessionExpired The first method ...
35
votes
4answers
4k views

Why is it the caller's responsibility to ensure thread safety in GUI programming?

I have seen, in many places, that it is canonical wisdom1 that it is the responsibility of the caller to ensure you are on the UI thread when updating UI components (specifically, in Java Swing, that ...
0
votes
0answers
83 views

What's the accepted way of communication between two model objects in MVC?

I have a model object that fetches data through an URL connection, and another model object that stores and parses it. Eventually when the data is ready, a key-value observing notification is ...
0
votes
1answer
407 views

MVVM model vs viewmodel

I am trying to wrap my head around MVVM and "models should not have behaviour". If my getter depends on an environment variable, should it be in the model or viewmodel? Does it make a difference if ...
6
votes
1answer
219 views

UI Design patterns for non-screen based project

I'm working on a small project coded in Python that uses a single button for input and a RGB LED as feedback, which responds to button presses and asynchronous events from the network. As the ...
5
votes
2answers
129 views

How to abstract from a display?

I'm building an embedded text editor consisting of a keyboard, an LCD display and a PIC32 microcontroller, to be programmed in C. The application should look, for example, like the GNU nano editor. ...
6
votes
3answers
328 views

Where in an MVC web application should writing files locally go?

In my web application that uses an MVC framework which has different modules for models, views and controllers I talk to several databases and APIs. Those are implemented as individual models. A lot ...
16
votes
6answers
3k views

Where should I put an API request in MVC?

I'm building a web application using a MVC pattern. Following this kind of architecture we can see that all the methods used to interact with database are implemented in the model. But what happen if ...
0
votes
1answer
55 views

VO to Entity Conversion

In our application we have multiple layers. UI -> This can be JSP/ JSON result of the API Controllers -> as in MVC Services -> perform single business operation per service DAOs -> Data Access ...
0
votes
1answer
108 views

PHP MVC concept large controller

I have custom MVC framework in PHP and my controller file has about 5000 lines. The question is, is it a big concept flaw? It is structured code with kiss method and quite maintainable. Are there ...
2
votes
1answer
72 views

Where to put the domain in MVCS

From what I've read and understand MVCS (Model-View-Controller-Store) is a design pattern that lets you do the following: View - Application view, what the user will see. Controllers - Manages the ...
0
votes
2answers
175 views

MVC is a kind of Design Pattern? [duplicate]

While I was trying to concrete the concept of design pattern, I came up with a question: As I asked in the title, Is MVC(Model-View-Controller) architecture kind of Design Pattern?