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

1
vote
2answers
267 views

Medical diagnosis selector

Alright, so my code is 'all over' and missing some fundamentals as regarding to the MVC design pattern.I should separate my concerns and I don't have a model layer and i'm clueless to how to implement ...
3
votes
2answers
125 views

Using viewmodel create comper and edit

I have this really long httppost action results that I add and update 3 db tables I think it's too long and can get shorter and smarter. ...
0
votes
0answers
24 views

MVC ViewModel interface

IViewModel.cs - Core view model interface. Allows for Paging results and serializing to a RouteValueDictionary(RVD). ...
1
vote
0answers
28 views

Use of HTML (view) in a constructor

I have this constructor (from a Service) where I'm setting a few variables, but two of them include HTML. Is there a best way to set those values, maybe by creating a method in the class to set them? ...
-1
votes
1answer
38 views

Laravel 5 controller to list appointments by date range and by label

I am starting to get into OOP using PHP and MVC. I just want to know if this code is good practice. Is this how I should be using my controller and model, in its simplest form? ...
2
votes
1answer
50 views

Validating user access to a function

I was reviewing the following code block and noticed there was validation check at the top. The 3rd line in the function checks if the invoice belongs to the logged in customer. I am wondering ...
3
votes
1answer
84 views

Creating an object-oriented router class in PHP

On my way to learn OOP, I am developing a little CMS using the MVC pattern. I would like to have some feedback about my router class, mostly about if I am correctly using OOP. Right now, I have a ...
3
votes
1answer
34 views

Generic Object Editing Classes with Controller, ViewModelProvider and DBUpdater

I am beginning to use generics and would like feedback on the following set of classes that will serve as the basis for an app that contains a large number of basic CRUD-y entities. I have used ...
3
votes
1answer
57 views

Utilizing Areas to handle subdomains with shared state/resources

I am currently working on a side-project and have the basic foundation and architecture I want in place for the site. I wanted to get your opinion and thoughts on my current practices and methods ...
3
votes
0answers
29 views

RESTful API for serving videos to a client

I'm building an app that serves videos to a front end client. My stack is Express/Angular/SQLite. The db doesn't hold users, only root. I'm concerned that my controllers are too hardcoded, but I'm ...
4
votes
2answers
65 views

First MVC Router

I'm learning the mvc pattern and today I finished my first mvc routing class. Hope you can give me some tipps and improvements. Router.php ...
3
votes
2answers
124 views

Keeping data processing out of controllers

I would like to start by mentioning that I am LAMP stack guy who happens to be making my first ever .NET C# web app and I'm seeking general advises for best practices and to see how more experienced ...
5
votes
2answers
62 views

Rails guestbook with new, index, and Kaminari pagination in the same method

I created a guestbook that on one page displays both the form for a new entry and all of the entries that have been created so far. I am trying to use Kaminari for pagination for the entries. Right ...
3
votes
0answers
36 views

Stylishly saving source

Simple tool to save a web page's source. Styled to resemble Sublime Text, given frequent personal use. I took the opportunity to learn and apply an MVC approach, the FXML is generated via Scene ...
4
votes
1answer
105 views

Optimize Data Sending/Querying to Parse Swift iOS

I have a swift method that I'm using to update Parse in the backend when the button is tapped. Votes are being updated: The method acts as a voting system, incrementing a label every time it's tapped. ...
3
votes
1answer
55 views

MVC flash card application

I am trying to learn how to build a very basic MVC structure before jumping on rails and other frameworks. I am working from a .txt file, and I organized a project into four parts: a model, a view, a ...
3
votes
1answer
103 views

Web API Interview Practical Test

A week ago, I applied for a 'Software Engineering Internship' at one of the company. Since I know C++, C#, Java well and have worked on couple of ASP.NET MVC projects with MS SQL server before, I knew ...
6
votes
1answer
319 views

Identity OAuth implementation with Owin

I am building an MVC 5 application using code-first Entity Framework 6 and a customised ASP.NET Identity model for authentication. I will only be authenticating against external OAuth providers ...
0
votes
0answers
25 views

Simple and reusable system for user registration and tracking and auto-updates - follow-up

This is a follow up question of this one. Since the original question was posted, it has turned out that in some cases I want the code to be synchronous and in others to be async. I have updated the ...
3
votes
0answers
50 views

Cat Clicker MVC

I'm training my coding and wish you guys to see how my code is. I made a cat clicker based on the MVC pattern. Basically it shows a list of cats and when you click a cat name it shows an image, and ...
0
votes
1answer
63 views

Uploading photos: Domain Model and Repository classes

In the database, I have a table with name photographs with the following columns: id ...
5
votes
2answers
193 views

Links controller in MVC N-layer architecture

I have a common issue that I face in my applications (because I don't know any better) and I want to improve. This is my usual structure: Project.UI (MVC Project) Project.BLL (Class Lib) ...
3
votes
4answers
119 views

Website news message edit panel

The explanation I'm making a website for a hypothetical theatre to get a better feel of MVC web-applications in ASP.net. The idea is that there are newsmessages that are displayed on the homepage, ...
1
vote
1answer
76 views

Monkey patch allowing virtual controller methods in PHP MVC application

I'm in the process of building a soon to be opensource CMS. 100% MVC. The basic idea is that a plugin should be able to add pages (read: methods) to a given controller, without needing to instantiate ...
2
votes
1answer
108 views

Separate model from DB mapper (entity manager)

I've read that it is good to separate model from DB mapper (entity manager) (but at the end, it is perhaps personal - just a matter of opinion). Anyway, if I understood correctly, I should not have ...
1
vote
1answer
58 views

Filter to convert duration to hours — in controller or model?

I have this before_action method : ...
3
votes
3answers
51 views

JobTypeLogic and JobType classes in MVC business logic

I am working on an MVC solution. My DAL layer I could solve with Repository classes, everything is working great. But in my BLL layer I have repetitive code: My CRUD is the same, my fields and ...
4
votes
1answer
70 views

Purchase-ordering

This is the Save function on my PurchaseOrder model in my real world production system. This code needs to write the state of ...
5
votes
3answers
131 views

ASP MVC Controller Unit Test

So I've been writing a unit test using Rhino Mocks to a controller in my ASP MVC application. The test passes, but I'm interested in your opinion and if there's something I should be doing differently ...
2
votes
0answers
67 views

Umbraco Macro-Script to grab Contour Form and Node Properties

When it comes to the Umbraco CMS, there are components called "Macro-Scripts" which are essentially a Razor View (.cshtml). They allow you to code a bunch of C# and ...
5
votes
1answer
286 views

MVC app to associate users with roles

I'm a beginner to web programming and just started a MVC project from scratch. Because this will become a large project eventually, I would like to make sure that I'm doing things kind of right from ...
-3
votes
1answer
73 views

Which way is better (matching Onion Architecture in MVC pattern) for using Provider?

In onion arch. we have multi layer structre: UI (User interface). BL (Business Logic / Services). RE (Repositories). UI uses BL to get data from RE with some conditions, my question is which is ...
4
votes
1answer
320 views

Layered architecture implementation in a Java web application

I am trying to learn how to design and implement a layered Java web application with a presentation layer, service layer and the DAO layer. I have used the Struts 1.3 framework with Java JDK 1.6 for ...
3
votes
1answer
407 views

MVC partial views and AngularJS modules

I am using MVC+Angular. In MVC, I created partial views for search, listing, etc. I show them using: ...
3
votes
2answers
81 views

MVC and Services

I'm writing and app in AngularJS and am learning about writing RESTful services. I also want to make sure that I'm understanding the MVC pattern correctly. In my code, this is my take on how I'm ...
5
votes
1answer
217 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
35 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
252 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
75 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
34 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
649 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
46 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: ...
0
votes
1answer
100 views

MVC router class performance

Can you review my code? ...
2
votes
2answers
77 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 ...
5
votes
1answer
71 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
76 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
75 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
107 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
311 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
58 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 ...