Model–View–Controller (MVC) is a design pattern for computer user interfaces that divides an application into three areas of responsibility. It is often applied to websites.

learn more… | top users | synonyms

-4
votes
0answers
58 views

Repository pattern with interface based injection [on hold]

I have been using option 2 below to refactor some legacy code. However, I have seen a lot of people doing injection using option 1. Can someone help me review the code below and let me know if there ...
4
votes
0answers
93 views

Small PHP-MVC system (for personal learning / use)

I've made an "simple" / "small" MVC-like PHP system. I've used some code of an project I used before and ask questions about it back then to. The thing is, it works (the admin part to begin with), ...
1
vote
1answer
28 views

Input field that dynamically monitors model value

This question is regarding my approach to the following implementation requirement. Can you suggest a better alternative that doesn't suffer from the issues I'll point out in my implementation? ...
2
votes
1answer
65 views

Currency converter using MVC pattern in C++ & QT

While understanding the MVC pattern, I came across this particular article. I thought to implement it using the C++/QT library. The intent over here is to implement/use MVC concepts in correct way. ...
1
vote
1answer
38 views

Formatting MVC 5 Razor link as a string

MVC 5 doesn't seem to like JavaScript that much. I am creating link in JavaScript to a success method in my Ajax call. Razor: ...
0
votes
0answers
26 views

MVC and asynchronous callbacks

I am currently refactoring my GWT client and try to apply the MVC pattern to all concerned classes. My problem is that I am not sure about two things here: Where do I control which view gets ...
4
votes
1answer
43 views

MVC Calculator Implementation with Java Swing

I know this might be a relatively large amount of code, but I'm just looking for any improvement, big or small, on my coding as I can. As part of my self-study in programming, I decided to make a ...
2
votes
1answer
35 views

The correct place to implode array - MVC and Repositories concept

I am writing an application with the repositories concept in php with laravel framework. In my controller I have this method: ...
1
vote
1answer
50 views

MVC router class performance

Can you review my code? ...
2
votes
2answers
53 views

Move code from controller to model

I'm working a rails application that has a lot of logic in the controller that should be in the model. In the app/controllers/customers_controller.rb#create there ...
3
votes
0answers
31 views

Redirecting a user

When the user clicks the first button ('Back to List' button), I redirect the user to the Employee List page. Can you please review this and suggest if there is any better way of achieving the same? ...
1
vote
2answers
51 views

Replacing an application service class with multiple command handlers

I have a Controller which uses an application service to accomplish its tasks. The service class is starting to grow big and developing multiple dependencies. So I am thinking of replacing the single ...
2
votes
1answer
47 views

Best place to locate filters in MVC n-layer web application and should I use services/repositories in them?

I am a little confused over which layers my filters should be contained in with an n-layer web application. I've got 4 layers: Presentation layer Application layer Business layer Infrastructure ...
1
vote
0answers
86 views

Login authentication model

I have made my model global so that I can work only a model with several controllers. Is it good or bad practice? And according to this, is my login process secure? Login check function in ...
3
votes
4answers
259 views

Product Manager managing product listings and prices

For school we have to develop a product manager. The basic task is to add new products. A product has a name and a price. I know the one or other class is currently pretty empty but its planned to ...
2
votes
1answer
53 views

Collection of $_POST data

I have a backend API that I'm sure can a refactor, but I'm not exactly sure how to avoid repetition between the store method and the ...
1
vote
2answers
46 views

Basic survey app

I am learning MVC 5 .NET and this is a bit different than Rails activerecord when creating relations. I have created a basic survey app that has a Survey class and this relates to the questions and ...
1
vote
1answer
102 views

CSV File Reader Project

I'm trying to focus on learning so I can get an entry level position and the best way for me to learn right now is to have someone review and provide areas of improvement. This project isn't entirely ...
2
votes
0answers
103 views

PHP MVC Service Layer Role

I wrote a series of questions in a previous post and a user recommended that I separate the questions. I have made the switch from procedural programming to object-oriented programming. I have ...
2
votes
0answers
154 views

Procedural to OOP MVC: Understanding Controllers, Models, and Service Layer

I designed a framework to make the switch from procedural to OOP design. This question will contain multiple parts I will bold each question to make reading/dissecting easier. I attempted to look into ...
2
votes
0answers
59 views

Model view controller

I will be implementing MVC model in my program but before that, I have done a simple program based on my understanding of the MVC model. I have three pages: The user will enter a value in page one ...
1
vote
0answers
29 views

MVC Swing Application

I want to make sure this is a good implementation of MVC. I started earlier with this code found here and it was horrible compared to what it is now. If it is a good implementation of MVC what, are ...
1
vote
1answer
73 views

PHP MVC simple controller design

I am currently rewriting a legacy PHP4 application to a MVC-style object-oriented one. As the most complex part is the models, I came up with the following controller-view scheme. I wanted to use only ...
3
votes
1answer
70 views

Communication between View and Controller in MVC implementation

I'm working on a moderately complicated (not super basic, but not a feat of programming strength) project to create a virtual tabletop for a tabletop game I play. I'm trying to conform to good design ...
3
votes
2answers
76 views

MVC refactoring parameter check

I had this code repeated in many Actions: ...
2
votes
0answers
66 views

XML to JTree app needs Model/View/Controller refactoring

I'm developing a JavaSE-1.7 Swing application that displays XML files as a JTree. This will be the base for further work, e.g. filtering nodes. My questions, as a ...
0
votes
0answers
114 views

Azure Active Directory controller

I have a class called AzureActiveDirectoryController. This class has some methods: one to create users, one to get the app name, one to register schema extensions ...
2
votes
1answer
72 views

Is it an anti-pattern to let ViewModel fill itself from a domain object? [closed]

Let's say you have a Employees table mapped to a Employee class. Now you want to code a Edit page for general information. You need a ViewModel with all the properties you need to build the page, so ...
2
votes
0answers
39 views

Maze player model view and controller

This is the player view model and controller for human player using a keyboard (easily extendable for over the network / split screen mode). The AI controller is posted in another post I've made ...
8
votes
3answers
616 views

Solving quadratic equation using quadratic formula

I've just started learning C# + MVC. Here's my attempt with MVC: ...
5
votes
1answer
54 views

Is my blog controller too “Fat”?

I would like some advice which relates to the "fat model skinny controller" concept in Rails. See my show action in the Micropost controller ...
4
votes
1answer
87 views

MVC'd login form

I've written this small MVC login application as an example for someone, would anyone let me know what they think of it? index ...
1
vote
1answer
49 views

Rover on a grid

I have ridden to much about MVC and SOLID, so I have a mess in my head. I have written a small MVC application and I need your experience and sober mind. index.php - Start point of my app ...
1
vote
1answer
43 views

Empty product model

I don't think I am using MVC concept in Ruby on Rails properly. Model accesses db, controller works on logic and view displays information/data. But in my below code, My Model code is empty. Can ...
1
vote
2answers
81 views

Helping a user manage a database

The following code will read a db, show the contents to the user and provide instruments to edit them. This has been tested and works well. model.php ...
2
votes
1answer
61 views

Controller to list users

I think I put too much code in my controller that was supposed to go in the model. This is a part of my controller, I'm not gonna paste everything since there is a lot of code. ...
-1
votes
1answer
193 views

Using async & await

I've been experimenting with some old code that needs refactoring in places and was testing if there was any improvement to iis threads etc by uploading file asynchronously (Server Side). I'm using ...
1
vote
1answer
175 views

Check if modelitem refers to currently logged in user with mvc identity

I'm using MVC in order to generate a couple of views within my webpage. For a way of logging in, I've decided to use Asp.net's Identity, which I am very happy with. However, I'm trying to find an ...
6
votes
2answers
425 views

Clear function for Stanford iOS 8 Calculator application

I am following the Stanford iOS 8 lectures and I believe I have successfully added the "Clear" functionality to the application, but I don't know if I am doing it properly. Controller ...
3
votes
1answer
167 views

Retrieving values from UITableViewCell

I have a UITableview with custom cells, every cell has a button called cellButton. When the user taps the button I present an ...
2
votes
2answers
180 views

MVC controller / PHP request dispatcher

After getting the requested controller from the URI request, it checks whether this exists and whether the requested method (default index) exists within that controller, then calls them. My ...
2
votes
0answers
42 views

Sports statistics controller

Is there too much logic in this controller (should I migrate them to the model)? How else can it be refactored? ...
10
votes
1answer
112 views

Hangman game using Java 8

I’ve been getting used to Java and I’ve written a simple hangman game using event-driven programming in Java 8. Please let me know of any improvements regarding the readability and design of the ...
3
votes
1answer
258 views

GUI flashcard program in Java

I'm new to Java and I've written a flashcard program in Java 8 that allows the user to create a collection of flashcards and then test themselves using those flashcards. Please provide any ...
1
vote
0answers
104 views

Java MVC Main Method and Controller

I'm coding a school project that involves MVC and threading. This is my Main class. From there I launch the actual client. ...
2
votes
0answers
123 views

Simple Java MIDI player followup

This is my second iteration of a simple Java MIDI player. I've made several amendments and would like to see if the code is now correctly implemented and readable. This follows on from the first ...
6
votes
1answer
102 views

Simple Java MIDI player

I created a simple program that allows you to create and play MIDI sounds. I've used the MVC approach and I’d like to know if there are any improvements to be made regarding the design and structure ...
2
votes
1answer
1k views

Calling Stored Procedure “insert query” using EF 6, UOW, and MVC 5

I'm a beginner in MVC programming, repository, and UOW using Entity framework. I tried to calling my existing SP in my MVC project using UOW and EF. Here is my code to mapping my SP in myDbContext ...
3
votes
0answers
217 views

Laravel controller for a commenting system

Can someone review my Controller? I should follow these guidelines: Code should be written with MVC pattern and to use OOP. The code now works fine, but I need to improve it. Also, should I use ...
1
vote
1answer
253 views

Implementation of MVC Bootstrap & Factory

Before I get started, I feel I need to list the following. I am not looking for an existing DI or Framework this is a personal project to shift from procedural to oop programming. Tear this apart. ...