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

0
votes
0answers
25 views

What is this file structure method called? [on hold]

I have been using this file structure for a while now and I'm not sure where I got the idea from (possibly PHPBB? Maybe Wordpress?) Basically, I create a page, like ...
5
votes
1answer
39 views

A simple web-app code - user registration. Is the layering ok?

So knowing the little pieces is something different and putting them together is something different. Here is the code where I try to follow good oop practices and 3 - layered structure. Any ...
2
votes
1answer
92 views

Is this right structure for MVC / MVP application?

I have written a code for an application/website that I wanted to be structured similarly to MVC design pattern (but I think it's rather MVP based on comparison I read). This functions as a kind of ...
9
votes
3answers
177 views

Listener/Observer Model in PHP

I've taken a look at the SPL Listener/Observer model but found that it doesn't work when using static methods. So I wrote my own but it's very simply. Can anyone suggest ways to make it more like the ...
1
vote
0answers
29 views

Modular dynamic based routing with wildcards

I've created this router for my framework and wanted to get some feedback on if it's the most efficient way to search the routes. The main router ...
3
votes
1answer
56 views

Session state wrapper, extending an existing application

I'm adding additional functionality to an existing MVC .net application, and to help prevent or at least reduce repeated reads to the dB I'm dumping a few custom entities in session. I'm limiting what ...
3
votes
1answer
101 views

Java MVC pattern

I recently posted a question about modeling a system that contains elements that can perform actions (here). The model runs in cycles and parts perform their action every cycle. The model should have ...
4
votes
1answer
56 views

Avoiding redundant code in MVC view page

Based on the true condition, I am making some operations. But I want to simplify the below HTML code in a better way. ...
3
votes
1answer
44 views

Is it a classical MVC (Xerox Parc) implementation?

I've been trying to understand the original MVC implementation (the Xerox Parc's one). I'm sure it has flaws, but it's a simple code to practice/learn the original MVC. Working example View ...
2
votes
1answer
95 views

Simple application to experience encapsulation

Looking at the code, is this a proper example of encapsulation? additionalComputer.php (class) ...
5
votes
2answers
71 views

Is it advisable to integrate SQL statements in the JSP pages that are not displayed to the user but handled at the back?

I have a signup form in which the user has to enter the email address and after some quick asynchronous processing at the backend I have to tell the user that whether the email address is already ...
2
votes
1answer
106 views

Where to put common method used in controllers that calls service layer?

I have an asp.net mvc5 web application using the repository pattern, and I have several controllers that need to call my _loggingService (queries audit logs) to get the last updated information for ...
1
vote
1answer
47 views

Is this a model? What is controlling it (controller?) and how does the data get to the view?

My goal is to instantiate a class based on the request and call a method on it based on the request verb. The classes I'm referring to will have methods such as ...
6
votes
4answers
759 views

Making a word processor

The Word Processor I had in mind would be similar to Microsoft's word and OpenOffice. I am trying to keep my logic separated from the User Interface and that separated from the controller, basically ...
2
votes
1answer
61 views

Is the “vanilla” implementation of TodoMVC really an MVC app? [closed]

As a learning process, I am trying to see how one best applies MVC in JavaScript without the use of a framework. As part of this process, I have been looking into TodoMVC, as it has a bunch of ...
0
votes
0answers
35 views

CodeIgniter maintain data through Controllers

I have a main menu in my application, it loads depending on the role of the user that I validate from a table in my data base, but I have to recreate this menu everytime I call a new controller, here ...
3
votes
1answer
85 views

Best practice for generating jQuery dynamical content

I am new user of CodeIgniter and I am trying to build an application that there are lots of jQuery dynamical content. Below I provide a code that I am using in order to be precise. The code below is ...
1
vote
0answers
40 views

Passing an object to the view in CodeIgniter

I'm trying to use an object and persist it into the data base. I created a class in the library's folder. ...
5
votes
1answer
112 views

Laravel model and controller interaction

I want to know if I'm going about creating and calling two functions from my model to my controller in the simplest and cleanest way. Model: ...
3
votes
1answer
172 views

Laravel 4 clean code review of users controller and model, trying to maintain MVC structure

I'd like you to review my attempt at creating an authorization class and let me know if there is re-factoring to be done and/or how I can make the code cleaner and abide by the MVC structure. ...
1
vote
0answers
57 views

Correct MVC in CodeIgniter

In my CodeIgniter I have a Login controller that load this view: ...
1
vote
1answer
29 views

Codeigniter view within a view

I'm calling a view into a view. Am I doing correctly, or is this a bad practice? ...
5
votes
1answer
142 views

Is this nesting of partial views poor design?

I feel like using this many partial views where a view renders a partial that renders a partial is just digging a hole of poor design, so I'm looking for any suggestions or guidance as to if this is ...
5
votes
2answers
429 views

Using a BaseController in MVC asp.net to reuse the repository

I have a repository class that impliments a repository Interface. In my Controllers I want a way to access the repository without creating constructors each time in the controller. So now all my ...
6
votes
3answers
128 views

HTTP scraper not clean and straightforwardly coded?

A job application of mine has been declined because the test project I submitted was not coded in a clean and straightforward way. Fine, but that's all the feedback I got. Since I like to ...
4
votes
2answers
72 views

Refactoring asynchronous JS pre-rendering code

A few months ago I wrote this module but, coming back to it, I find it a bit hard to read and reason about. I want to ask community's opinion on whether this needs to be refactored, and how I could ...
2
votes
2answers
128 views

Is this data access layer design good?

I am working on an ASP.NET MVC-5 project, using code-first approach for database design. I have a question about my code design. I have an Entity in my database schema called ...
2
votes
1answer
48 views

How to optimize the code in order to reduce the loading time of page?

I'm using PHP, MySQL, Smarty, jQuery, etc. for my website. I'm using a MVC architecture to develop the website. Now in one of the functionality I'm fetching a large amount of data and perform some ...
10
votes
2answers
144 views

toString() in a model or view layer?

I would like to ask those of you, who are a little bit more expirienced in development. I would like to ask about toString() method usage. In what situations do you ...
0
votes
0answers
63 views

Symfony2: Refactor messy Controller action

I have a fairly ugly controller method I would like to refactor / extract. I can only test this in a integration type test which kind of signals a code smell. The method processes the form and needs ...
2
votes
1answer
622 views

Review my PHP router class

I'm writing yet another mvc framework just for learning purpose and i would like you guys to review my code. Whenever i'm coding i have that feeling that my code is horrible and not the most efficient ...
2
votes
1answer
113 views

Need reviews for an authentication system

AccountController Code: ...
2
votes
1answer
135 views

Is the structure for this MVC Blog ok?

I made a MVC Blog based on a tutorial for a framework from here. It's not finished yet, but I want to know if the structure and the classes are ok and what can I change. Feel free to say anything. ...
1
vote
1answer
2k views

Java MVC and code example

I have a MVC design for a GUI Java program. I was wondering if: Someone could either comment the code to help me out in understanding what I am doing better. Help me fix newbie mistakes to make ...
2
votes
1answer
513 views

Builder pattern for Codeigniter ActiveRecord queries

I am using Codeigniter and it's ActiveRecord. I had this idea for a base class that provided a generic getter/setter for doing simple queries on a database. I have a lot of database objects that ...
1
vote
1answer
1k views

Basic PHP MVC setup for form submissions

I'd like your thoughts on this basic implementation of MVC. The view outputs a form, and when the page is loaded, the controller checks for a form submission and then updates the model accordingly. ...
0
votes
1answer
475 views

PHP MVC: how to do $_POST the right way

I am not sure if I am doing right on how to handle $_POST data in MVC pattern. Below is my attempt. Am I doing it right? // Dummy $_POST data, ...
2
votes
1answer
173 views

How to put XML results in the MVC pattern?

I have been writing PHP programs in the MVC pattern for quite some time. But I am not sure if I am doing it right. For instance, I have this PHP file that prints a result in XML, and I put this file ...
1
vote
0answers
260 views

Tiny MVC - Handling validation / sanitization in a model

I was told to post this here - original post. I'm fairly new to MVC concepts and PHP input validation. I'm open to all input, but I'm largely wanting to know if the following: Follows the MVC ...
0
votes
0answers
110 views

Model Input Sanitation / Validation - Is this acceptable?

I'm fairly new to MVC concepts and PHP input validation. I'm wanting to know if the following: Follows the MVC pattern correctly - if not, how can I improve it? Has any huge apparent security ...
0
votes
1answer
65 views

Javascript MVC Design Feedback

I would like to share my design of mvc via js. What do you think about it? I tried to not use any mvc framework but i want to get clear structure and a decoupled organisation. Next step for me is ...
3
votes
1answer
637 views

TicTacToe - introduction to MVC pattern

After reading about MVC pattern in Head First Design Patterns, I've decided to write a TicTacToe app. I will not reveal the source code of the classes Matrix, ...
3
votes
1answer
287 views

First attempt at MVC JavaScript pattern

I would really appreciate a review of my interpretation of MVC here. It's as bare bones and clear as possible. I've based it on some in-depth reading but I don't know if I have understood everything ...
1
vote
3answers
387 views

Look over my code for PDO and MVC

I'm building this website with PDO and Pattern MVC. I'm currently working on the login page and would like to know if this structure is correct for MVC pattern. I'd also like your opinions and ...
1
vote
1answer
96 views

Which parts of my code are redundant?

Hey guys I have the following code, which i kind of just put together sloppily since I'm not really familiar with Razor/html... but nonetheless it does what I want it to do, which is basically passing ...
2
votes
1answer
333 views

Structure pages mvc + oop

I am developing a website and I want to use PDO and MVC. Before, I was coding in procedural MySQL, but I'm starting to understand the object-oriented programming. My problem is the following: If I ...
5
votes
1answer
228 views

First introduction to MVC

I'm not sure that I fully understand this pattern. I've written a simple application that uses MVC. Please criticize my approach to the use of this pattern. For convenience, I'll post the source code ...
1
vote
1answer
33 views

Nested routes and proper place for a function?

I have a rails app and in it I have two models, widget and votes. Votes are used to keep track of the desirability of a widget. So in my models I have: ...
5
votes
1answer
583 views

Combining a JFrame, AbstractTableModel, and SQL Query

Building on my previous questions. I've managed to make a GUI that queries a SQL database and displays the result in a table. Christ, it's a lot of work for such a simple activity. The code below ...
1
vote
1answer
107 views

Decoupling MVC model methods in java

I have a basic swing application that I am trying to develop using MVC structure. The principal class in the model connects to a derby database and retrieves values from columns and stores them in ...