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

learn more… | top users | synonyms

4
votes
1answer
117 views

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

The problem / question 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 ...
0
votes
0answers
40 views

interaction between algorithm and user interface

I'm building a desktop app that has many different algorithms implemented. Some are straightforward others not so much. Some are linear (input is simple) some are not (may require additional input ...
1
vote
1answer
471 views

How to efficiently handle related data in MVC?

Talking about MVC with servlets and JSP's, in a context about products and manufacturers , when querying the application for a list of products: the servlet loads a list of products from the ...
4
votes
4answers
10k views

Use a service layer with MVC

If a controller gets too fat and model instantiation starts to add up, a service layer could be used. If I just wrap the logic inside a service class, I will get a bunch of Services with one/two ...
1
vote
1answer
93 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 ...
1
vote
0answers
16 views

Why separate routes and controllers in MVC backend applications?

I've dabbled in a few MVC frameworks (like Rails and its ilk) and I've noticed that the file that defines restful routes often go separate from controllers which hold the actions executed through ...
4
votes
1answer
682 views

Rewriting a Procedural PHP App - Should we use a framework?

We have an app that's currently only got about 120 users. The userbase will probably grow by 50% over the next 12 months - but we're going to have to separate storage etc. because we're looking at ...
0
votes
2answers
155 views

Should a Junior programmer add TDD tests to mvc project

I'm a junior programmer near to my 6 month probation, following my initial career changing 3 month assignment in which I added TDD tests and wondering whether I should add tests to my current work. ...
3
votes
1answer
705 views

Do I need JUnit tests for the controller layer on a MVC when I have a database layer

I have a MVC which has this structure: ui controller db model Basically the controller doesn't really do much more than connection ui with db layer. Do I need to provide JUnit tests for the ...
1
vote
1answer
118 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 ...
6
votes
1answer
182 views

MVC - Do I create 'joint' layers when dealing with multiple models?

I'm new to MVC and the different layers architecture and this is what I have currently: 2 models: User, Company 2 service layers: UserService, CompanyService 2 interfaces which abstract the ...
1
vote
1answer
53 views

c# extending a entity framework class

I have a Entity Framework class that was derived from the database layout. I was wondering if there was any problems by extending the class by creating another cs file and using the same public ...
0
votes
1answer
228 views

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, ...
0
votes
0answers
44 views

Laravel Modules based structure

I am building a social network app and I have decided to have following features as of now. Meetups / Events (Users will create events and other users will have options to join ) Q / A forum (mini ...
1
vote
3answers
101 views

Is a TCP client/server a good solution for a system which can be controlled by a GUI running on multiple platforms?

Consider a software which runs on a dedicated system (basically a Linux box), and controls some machinery. The system has all the required hardware interfaces for the task. The software also has a GUI ...
1
vote
2answers
188 views

Do common MVC frameworks violate the LSP and is there a MVC framework which does not?

You who have worked with a framework implementing the MVC architectural pattern most likely know how these frameworks are usually implemented. They contain a base Controller class, which you extend, ...
0
votes
1answer
100 views

JavaScript & AngularJs Modules Implementation technique and structure

So Im building an app and I'm trying to implement the structure of the app so that its robust and scalable in future. My app is mostly divided into JavaScript Modules (revealing pattern): // ...
0
votes
1answer
240 views

JEE MVC, controller calls the interface instead of the interface implementation

I'm following this tutorial: http://wiki4.caucho.com/Building_a_simple_listing_in_JSP It creates a basic web application in Eclipse using the MVC pattern with Resin as the web container. Here's the ...
0
votes
4answers
712 views

How do I design my application to use REST for itself?

I'm not sure how to ask this. I know this is simplistic, but I understand (I think): REST is an architecture, not required, simply a way to build REST is a style and a community standard for ...
-1
votes
1answer
52 views

(Re)structuring a Qt Project [closed]

A PySide project I've been working on for a while now has started to grow to a point where it's becoming large enough that I've had to step back and re-think the overall design. I've spent some time ...
3
votes
1answer
203 views

Do Rails Join Models Get Controllers?

I have a rails app where my users can buddy up with other users. Since that relationship can have a status (approved/rejected/pending), I decided to go with a join model (UserRelationship) so now I ...
1
vote
1answer
971 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
1answer
59 views

static method, helper function or in the controller, where does this go?

I'm working on a piece of functionality that simply allows a guest user to perform an action a certain number of times before requiring them to login\create account. In this instance, they can vote on ...
2
votes
2answers
299 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 ...
-1
votes
2answers
70 views

Creating an ASP.Net MVC web application that can work on different operating systems

I have been developing and deploying many ASP.Net MVC web applications under Windows Server 2008 R2 & Windows Server 2012 R2, and I used IIS 7 & IIS 8. At the same time I know that I can ...
1
vote
2answers
66 views

Should a client check for persisted item existence before modifying it?

I'm developing a MVC Web application with a REST interface. The REST controller performs actions on persisted items through a service class, which translates exceptions coming from the persistence ...
1
vote
3answers
176 views

What is the correct name for this data object?

I need to understand the proper name for an object that has cropped up in two projects now. Here is the conventional representation for the MVC pattern: However there is another "Model" that is ...
1
vote
1answer
1k views

Performing user authentication in a CodeIgniter controller constructor?

In "The Clean Code Talks -- Unit Testing", Miško Hevery mentions that "as little work as possible should be done in constructors [to make classes more easily testable]'. It got me thinking about the ...
1
vote
1answer
173 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. ...
9
votes
3answers
670 views

Is it reasonable to build applications (not games) using a component-entity-system architecture?

I know that when building applications (native or web) such as those in the Apple AppStore or Google Play app store that it's very common to use a Model-View-Controller architecture. However, is it ...
2
votes
2answers
145 views

is it bad practice that controller call repository instead of service?

is it bad practice that controller call repository instead of service? to explain more: I figure out that in good design controllers call service and service use repository. but sometimes in ...
0
votes
1answer
90 views

If AngularJS already takes care of the MVC, would using ReactJS be needed if it is just the View part?

I heard that AngularJS is becoming quite popular, and at the same time ReactJS is also. But if AngularJS already takes care of MVC with 2 way binding between model and view, would ReactJS actually be ...
2
votes
1answer
225 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
1answer
129 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 ...
-1
votes
1answer
49 views

Find out the user has access to this area - role [closed]

I am in the process of building such that the user access to the different kinds of areas. I must have sure me that, for example Admin part is for shared Admin. It is for sure me that I can ...
-1
votes
1answer
99 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 ...
-1
votes
2answers
502 views

Where and how to reference composite MVP components?

I am learning about the MVP (Model-View-Presenter) Passive View flavour of MVC. I intend to expose events from view interfaces rather than using the observer pattern to remove explicit coupling with ...
5
votes
2answers
55 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 ...
12
votes
4answers
948 views

Switch vs Polymorphism when dealing with model and view

I can't figure out a better solution to my problem. I have a view controller that presents a list of elements. Those elements are models that can be an instance of B, C, D, etc and inherit from A. So ...
2
votes
4answers
100 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
20 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(){ ...
2
votes
1answer
149 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
67 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 ...
1
vote
1answer
29 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 ...
9
votes
3answers
4k views

In MVC should a model handle validation?

I am trying to re-architect a web application I developed to use the MVC pattern, but I'm not sure if validation should be handled in the model or not. For example, I'm setting up one of my models ...
12
votes
1answer
304 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
2answers
154 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 ...
1
vote
3answers
171 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 ...