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

2
votes
0answers
23 views

Which pattern could help to refactor this controller code?

I know I should use services and patterns to refactor this controller action, but I can't imagine one that could fit/be appropriate for this problem. It seems a strategy or template, but a strategy ...
3
votes
1answer
128 views

Portfolio landing page

I'm trying to grasp this whole MVC design pattern idea but I'm in the dark if I'm doing it correct. This is where I need some feedback on what I've done so far. Here's what I'm wondering: Does the ...
1
vote
1answer
66 views

Dependency Injection With Unity in MVC 5 without repository and unit of work

I want to use dependency injection with Unity in my application. I am not following repository pattern and unit-of-work (and don't want to). I also have ViewModel in my controller action method. ...
15
votes
1answer
247 views

Order a delicious pie here

For a quick summary: I've created this internal web application, and I've hit a point where I can really see the mess I've made. I need some help separating the logic, the view, and the data. More ...
8
votes
1answer
64 views

Refactoring my Todo List was on my Todo List. How's my MVC?

This is a follow up to Rolling my own Configuration with UI. I got a lot of great advice about the Configuration system I created, but no one touched on how all of my logic for the UI was in the code ...
-1
votes
0answers
36 views

View for getting and displaying data

I have code that displays the data that it gets. However, because I could not think of a good way to do this I have ended up putting most of the back end in to the view. Just a quick note about the ...
4
votes
1answer
158 views

2D board game: good Model part?

First time writing a big project in OOP. I am quite used to scientific programming but not to OOP, and even less to building GUIs. I am writing a 2D board game: the player can move on a map from tile ...
4
votes
1answer
153 views

Data model in MVC for multiple providers

I have constructed an API service that dives into a storage engine and retrieve data. I have tried my best to apply the MVC modelling with services (repository) in mind where the controller (as it ...
1
vote
0answers
21 views

Newsfeed app for allowing custom Reddit feeds

I'm currently working on a newsfeed app (see it live here or its files on GitHub) that lets a user create a custom Reddit feed. The user adds the subreddits they'd like to view, and then can view them ...
2
votes
0answers
109 views

MVC Login for Android

The code for my Android application is below and so far I'm happy with it. Before anyone comments, I do acknowledge it requires the addition of further validation. The android application is a login ...
2
votes
0answers
43 views

Binding model to view

What I need - if there are some changes to model in must be rendered in view (HTML). The main problem here is to catch changes in model. Firstly I tried to use watch. However it can't work with IE8 ...
5
votes
3answers
125 views

Code redundancy issue while feeding dropdownlists

I have a dashboard to manage a learning center system. There are scenarios like admin create learning center and define a classroom in it and then assign some courses in it and assign students to ...
3
votes
2answers
65 views

Using a registry with static container

I am currently working on a class to make objects and vars available to child classes while attempting to avoid a singleton. Each child with dependencies extend this class and pass params (var names) ...
1
vote
1answer
87 views

Account view with MVC and paging

My Model ...
5
votes
1answer
122 views

Tic Tac Toe in MVC

Do I have basics of MVC and SOLID principles right in this simple 'Tic Tac Toe' game? View.java ...
4
votes
3answers
120 views

Make huge view in C# readable and maintanable

I have an application that is using MVC5 with C# and Razor Engine. This view displays a huge table: ...
5
votes
2answers
292 views

Unit of work Repository pattern DBcontext EF-Entities and ninject

I am totally confused while implementing Repository pattern with unit of work and Entity framework because I have seen tons of examples. Please suggest whether I am on the right track or not. ...
1
vote
0answers
59 views

Making a CRUD function reusable

I uses slim router and made a folder model controller view, below is one of my model files; I made one database with one model. I have some problem in my project: there are several databases like ...
2
votes
0answers
77 views

Usage of MVVM in iOS [closed]

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) ...
0
votes
0answers
42 views

Validation in Node.js

I'm building a NodeJS application, but I'm not sure what will be the best way to structure my code. I have the following model: ...
0
votes
1answer
49 views

Implementation of a URL router

I was wondering if you could provide some feedback on this Router class I built. Worth noting that it relies on an Apache rewrite rule that always redirects to this file, but passes the path into ...
0
votes
2answers
72 views

Displaying a city name with concatenations

I am learning MVC and Android. I have create a sample program which is supposed to implement the MVC philosophy. I plan to build my codes on top of this. I wish to know whether I have got the concept ...
3
votes
1answer
77 views

Null checks in view

It's really a nitty-gritty issue for me, and I have been here many times before. How could this be improved? I have a basic viewmodel for a view: ...
4
votes
3answers
71 views

PHP Bilingual Error System Ideas

I am building a php based mobile website that must be in both Spanish and English. This is my first bilingual site so I've been having to re-think a lot of coding practices I currently use to ...
4
votes
2answers
144 views

PHP MVC model structure

Just looking for some feedback for one of my models I have for a project. I'm pretty happy with it but I was wondering if anyone had any optimization suggestions. ...
6
votes
1answer
110 views

Enhance MVC implementation

I know that there are several ways to develop the MVC pattern. To improve consistently my knowledge, I would like to get some advice and feedback. How could I enhance my code? I knew that there are ...
2
votes
0answers
42 views

MySQL natural search and like search

I have written two queries for searching, but I want to simplify them as it seems needed. ...
5
votes
1answer
372 views

Road to MVC: the case of Settings Table View Controller

Now that I know that MVC can help do better code, I want to make my SettingsTableViewController class conform to it. ...
1
vote
1answer
85 views

Diving into PHP's MVC - the application's core

I recently started programming in php using the mvc-pattern, which resulted in one of best choices, I did so far, but I read through many articles showing "easy" examples and some of them were quite ...
5
votes
2answers
295 views

Rails controller method that conditionally filters results

This code for my blog checks to see if tags are in the params hash. If they are, then only posts that are tagged will be paginated. Otherwise, all of the posts are paginated. ...
1
vote
1answer
125 views

Model binding with a ViewModel

I have two ViewModels with the one referencing the other: ...
2
votes
1answer
94 views

Any improvements for my LoginController class?

This is probably going to be my final question regarding controllers. I feel like I have a good enough understanding of them now and am able to write them cleanly. I've recently adapted a less error ...
6
votes
1answer
178 views

Is my LoginView class valid?

I know the Model, Controller and View's purpose, but I have never really found a good concrete class example of a View class. Usually I see people having some small ...
1
vote
1answer
113 views

Structuring a user authentication system

I'm new to the MVC model. This is where I started: User authentication system. After questioning, reading and thinking a lot, I was able to write a small framework (don't know if 'framework' is the ...
2
votes
1answer
100 views

Is my design achieving Separation of Concerns in this MVC implementation?

I've read lots about getters and setters being evil, unless there is good call for one, but I cannot figure out how to implement that knowledge into my Model layer. Say in my Model layer I have a ...
5
votes
1answer
141 views

Service class that handles form validations

I've made a (service) class to handle all form validation of my application. It contains a set of frequently used validation callables extracted into private methods that I use to build each ...
1
vote
0answers
89 views

Mini eCommerce Application and Message/Warning/Error Handling

I decided to build a basic eCommerce application in c++ as a learning experience. In the past, I've gone with a fat controller, skinny model approach, and while it has worked, my results always end up ...
0
votes
1answer
113 views

Implementation of inheritable pImpl idiom and MVC pattern

I am trying to write an object "template" that use pImpl and MVC pattern to encapsulate everything not specific to the object. The following is how I tried to attempt it. I am sure that the code ...
4
votes
2answers
78 views

Should this Method be in TableViewCell or ViewController?

I have a custom tableview cell for displaying different foods, with a star next to each name. If the food has been favorited (i.e., it exists in the database), the star is filled in, otherwise it is ...
4
votes
1answer
72 views

Model class for networking that uses notifications

I just finished a model class that represents an Instagram Networking client for my iOS app. I am specifically looking for a review of my use of static constants. These are strings that represent ...
3
votes
0answers
87 views

Heterogenous tree in the application domain: How do I represent them?

The Domain I have three types of items in my domain: ItemA, ItemB, ItemC. (I can't use their real names.) ItemA has one attribute: thing_id. ItemB has 6 attributes: thing_id, name, description, ...
12
votes
2answers
368 views

My final sign up controller

I've asked a couple of questions here before regarding my controller, but I think I've finally gotten to understand controllers completely, but I'll never be sure unless I get my code reviewed. I've ...
6
votes
1answer
148 views

MVC Model validation callback

I have made a simple MVC framework of my own for my personal website to learn a thing or two about how this whole thing even works. I think I've got the idea, but there's one thing I'm not sure about. ...
3
votes
2answers
46 views

Further refactored Model class that represents a calculator

Here is my Model class's new header file: ...
4
votes
3answers
83 views

Model class representing a calculator

I have a simple Model class that represents a calculator. Here is it's header file: ...
1
vote
0answers
115 views

Extending the MVC Routecollection

I'm currently developping an MVC framework on which I will be writing my websites. This is done through the usage of a starter kit. In standard MVC, your routes are registered like the following: ...
3
votes
1answer
147 views

Swing MVC and Command Pattern

I am writing an application with Java 8 using NetBeans, and want some reassurance that I am going the correct way with this. I am finding it tough because of the use of Swing. I have gone for one ...
6
votes
2answers
2k views

My boss re-wrote my PHP/Yii controller code. Which is better?

I was recently asked to write a Question-and-Answer feature for my company's product pages using Yii 1. It was my first Yii project, and it was a little rough around the edges (Code A). However, when ...
6
votes
1answer
108 views

Java MVC Implementation

I am trying to write an MVC based application from scratch using Java 8 and Swing... I am having some difficulties with this. I want to know if I am going the correct way about this... My controller ...
2
votes
1answer
91 views

MVC Form Handling

I just would like to know if I am heading in the right direction with this. I am trying to learn and understand the concept of MVC, and I am doing that while making my own webpage, so I can learn a ...