Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [mvc]

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.

1
vote
0answers
27 views

Applying Observer-Observable pattern to a code and multithreading

I have to: 1) Apply the Observer-Observable pattern to the original code. 2) starting from the original code, I have to suppose that the modification of the array fields (slot machine numbers) ...
0
votes
1answer
57 views

PHP OOP MVC Project Structure

I'm a beginner in OOP and PHP frameworks. I used slim skeleton to create a project and designed the project in this way. Project structure is given by the slim skeleton. Object Mappers are added by ...
1
vote
1answer
72 views

Simple MVC built in PHP

I tried to make a MVC in PHP with OOP approach. Code Review this so I can understand whether am I using the best practices and can I legally call it a MVC framework or not. Also, I am going with 1 ...
1
vote
0answers
72 views

Controller method to add a folder to a tree [closed]

I am using the jstree to get a tree structure in my MVC application. I am actually on showing javascript errors, when something is wrong. In this case, returning an alert to Javascript. Furthermore I ...
1
vote
0answers
47 views

Symfony controller to register and activate users

I've been in an interview some time ago. They objected my Symfony API code with following line: Too much code in controller actions. Can be moved to services to keep the business logic apart ...
1
vote
2answers
54 views

Simple router in PHP

Before I start writing my first MVC framework, I want to improve my code quality as much as I can, can anyone give me some constructive criticism on how I can improve this? It is a simple router, ...
-1
votes
1answer
30 views

Laravel function to add a supplier, and associated addresses and contacts

I have a function addSupplier() that adds a supplier. Each supplier has multiple addresses and each address has multiple contacts. ...
1
vote
1answer
40 views

Showing data for a chat with another user

I have a get route to show the data for a chat with another user. If an existing chat exists I want to return that, otherwise create a new chat and return it. ...
3
votes
1answer
243 views

Simple Python calculator applying MVC

I've been implementing a simple Python calculator for learning purposes. Since there are no properties or bindings like in Javafx, I implemented my own MVC pattern. I'm aware of missing logic like ...
2
votes
1answer
111 views

ToDoApp - adding users, managing tasks, getting tasks

I've implemented a console ToDo application. I would like to hear some opinions about it, what should I change etc. About project: It is intended to manage everyday tasks. Application contains: ...
2
votes
0answers
143 views

Python (Sanic) Routing

I am new to Python and wanted to explore how I can associate routes with "controllers" with Sanic as a base. It works fine but "feels" a bit clunky but I can't put my finger on why/how. routes.py - ...
1
vote
0answers
48 views

Small website with MVC

I'm struggling if this is the correct way to implement an MVC-like pattern for small websites. I have separate controllers and models, my main concern is the view part, did I understand it correctly? ...
5
votes
0answers
186 views

Battleship MVC Architecture

The entry point is the Macros module, which - for now - includes only a single procedure, at a very high abstraction level - I'm quite happy with this: ...
3
votes
1answer
108 views

Text editor using MVC pattern

I am beginner in programming and recently I wrote an editor, inspired by the Notepad program, with all basic features any editor should have, like finding, undoing, copying, etc. The problem is I do ...
0
votes
0answers
35 views

Android mini game background handler

In the same project as in my previous questions I have released a new beta ("0.1.24b") of the game we call "Moon Buggy". It is now possible to get the background to change when completing a section, ...
0
votes
1answer
93 views

Custom MVC framework

So, I've been working on a very simple MVC framework and I wanted some feedback on how it works. I've worked it slightly differently where the controllers don't need to extend the base ...
1
vote
2answers
131 views

Simple Java MVC (swing)

I'm a Java beginner currently practising MVC pattern and came up with this. Could you please check if this is a proper implementation of MVC and if there are any best practices that I have broken? <...
-1
votes
0answers
383 views

A basic MVC with routing and login system in PHP

I started working in PHP and I wrote several things before I noticed that I'm not sure if I'm doing DI right. So, I need someone to review an example of my code and tell me what I did wrong, and I'm ...
1
vote
2answers
144 views

Creating an MVC router

I created an MVC router based on knowledge of an MVC design pattern. It will simply take a URL as a string (class/method/params...), then it will instantiate a requested class controller and call its ...
5
votes
1answer
343 views

Convert IEnumerable<Reads> to CSV

I have an IEnumerable of a view model that I need to convert to CSV and send back as a file response. I have written it out quite manually and I'm just seeking code ...
4
votes
2answers
463 views

Java Snake game using MVC with difficulty settings, persistent stats, and sounds

I completed two intro computer science courses on the basics of Java programming and data structures in university, and have continued to study programming on my own over the past few months. This is ...
3
votes
0answers
125 views

Conway's Game Of Life using SFML and MVC

This is a follow-up to my previous question. I followed the given advice and implemented the MVC design pattern. As I've never used MVC before I am quite unsure about the quality or if it is even ...
4
votes
1answer
142 views

Upload and database insert php function

I love to post here on codereview my code to have a feedback from developers that have more experience than me, to improve my coding skills. During these days I'm working on a webapp for a small ...
0
votes
0answers
429 views

Auction bidding logic

I am currently working on an Auction site with ASP.NET MVC and I have a functioning bidding process. On my items detail page I am showing the bids for that item in descending order for the amount and ...
0
votes
2answers
169 views

Ruby on Rails application controller

My application controller keeps growing with small helper methods that I use in both my controller and views, is it okay? or what do you recommend doing? ...
1
vote
1answer
55 views

store and warehouse management class

I've already posted this PHP class few days ago when I started writing it. Now that all the methods and all the controller logics are ready, I will be ask here for some suggestions about how to ...
6
votes
1answer
196 views

Winform, with a workaround to avoid dependencies

I'm working on a Winform project. We currently have a modular design (shown in the image) in our project. Where on every user action (button clicked or selection changed etc), first we set the Model ...
10
votes
3answers
810 views

Simple dice game - JavaScript MVC implementation

I did a simple dice game using what I learned about separating the 'view', 'model', and 'control'. I am quite clear on what the model is (it's the data and state). But I'm a bit confused on the ...
4
votes
1answer
137 views

Laravel UserController Design

...
2
votes
0answers
95 views

How to optimize code to only pull separate table rows that are necessary

I have a Company Class, and separate normalized Address Class. I did this because the Address table will hold more than just Company Addresses, so I don't want "CompanyAddress", "EmployeeAddress", "...
3
votes
1answer
552 views

Simple PHP Router for home grown MVC framework

I don't know if you guys get tired of seeing a bunch of requests for review of similar projects, but I was really looking for advice. My website is designed on the MVC pattern. I have a very simple ...
2
votes
0answers
48 views

Implementation of MVC pattern for single and multiple objects

I've implemented a student administration with MVC pattern (Tutorial: Link). I've decided to divid the students in "SingleStudentModel" and "MultipleStudentModel", but I'm not sure if that make sense ...
1
vote
0answers
37 views

MVC implementation for displaying movies on main page and by category in PHP

In order to improve my PHP skills I decided to implement my own MVC in PHP. So far it can display movies on the main page and show movies by categories. Obviously I use rewrite mode in ...
3
votes
2answers
101 views

Image Database Service

I created simply database service with get, insert, get all image names and verify exist method. All images will be store in blob storage with unique filename + postfix size. Next one I have image ...
5
votes
0answers
257 views

ATB strategy MVC architecture refactoring

NOTE: this question isn't as long as it appears to be. I added the comments to the code only to answer some possible questions that may appear. I'm making an active time battle strategy. Its ...
4
votes
2answers
227 views

Java TicTacToe MVC with Singleplayer mode

To practice the MVC pattern and Unittesting in Java I decided to make a simple TicTacToe Console Application. The features of this App are: Multiplayer-Mode Singleplayer-Mode (that should always ...
2
votes
1answer
83 views

Wiring classes together in PHP

I've created a base structure for my project and found a way to wire classes together, I create an array of previously loaded classes and call them from the cache. I then have a static class that ...
3
votes
2answers
162 views

Web browser in Swing with MVC

Follow up question to: Utilizing OOP when creating a web browser After I received help on the question above, I've created 3 classes for my Browser. ...
1
vote
2answers
762 views

A Quiz game realized with MVC-Pattern (Java)

Project description The program can be tested here This project is an exercise designed to check if I understand the MVC pattern correctly and apply it correctly. A quiz is to be designed in which ...
0
votes
2answers
96 views

Decoupling UI code from game logic

IIUC I should decouple UI logic from the model and controller in my project. I didn't succeed and had to resort to TextView etc in my game logic: ...
1
vote
1answer
53 views

Clear data-model layer in Django MVC

I have a Django model User ...
1
vote
0answers
76 views

PDcurses wrapper module, with mvc or pimpl

I have been writing a library wrapper for pdcurses for a while and implemented each widget/class in it with the pimpl idiom, however I start to see that for large widgets it creates a god object and ...
1
vote
1answer
70 views

Controller with abstract methods for a delete method

I'm studying OOP and MVC structure, and all my controllers extends the main controller, and almost all of them has a delete method, basically this: ...
1
vote
1answer
615 views

HttpClient wrapper for simple calls with optional cert

Trying to ensure each controller contains it's own httpclient. The super user can change which endpoint is called from the site and some of those endpoints do not require a certificate, but some ...
2
votes
1answer
570 views

iOS Set game implementation

So I'm working through a MOOC, Stanford's "Developing iOS 11 Apps with Swift", and in the course the professor highly emphasizes how important it is to separate your View from your Model in the MVC ...
2
votes
1answer
115 views

Codeigniter Controller for work orders

I'm working on a project and one of my controllers is getting quite large and hard to maintain or add to. I'm having trouble deciding what belongs in the controller and what I can move to the model. ...
8
votes
1answer
217 views

SFML dice game with logic-presentation separation

I asked for feedback on my Dice class and I was suggested that I should separate logic from view. I decided to completely refactor my project and I'd like to share ...
2
votes
1answer
71 views

AngularJS - Making Factory and Controllers DRY

The following code works, but: The service makes multiple API calls, the functions are very similar with a lot of code duplication. The same is true for the controllers- very similar code with only ...
1
vote
1answer
94 views

Fat-free MVC Controller

I have this class containing a method that performs a few processes for displaying the payment page. ...
-1
votes
1answer
121 views

Delete copy constructor and assignment [closed]

I am writing a program with C++ and since it is going to be big and a lot of people will edit this, I am going to use the MVC pattern. The question is very easy. There is a controller that is the ...