We changed our privacy policy. Read more.

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.

Filter by
Sorted by
Tagged with
0
votes
0answers
37 views

'Lean controller'/'Business logic on service' and filtering, sorting, pagination methods on controllers

I'm currently reading about "Lean controllers"/"Business logic on services" and trying to refactor a legacy code. However I am struggling to apply what is taught in the tutorials ...
1
vote
1answer
106 views

Is My Controller too Coupling?

To put it in context, I had the assignment to do for a job interview in Node.JS, which basically making CRUD with products (and it have certain conditions). The assignment was well-understandable, and ...
5
votes
3answers
722 views

Employee Model definition without an ORM

I am the author of this code. It's from an actual project, and it returns the desired result. However, I am very concerned that I'm not defining my Model correctly. The Model is instantiated in the ...
1
vote
1answer
58 views

Best practices in regards to pass and deserialize data, when calling an API endpoint from a MVC-project?

In my application, I only show users their own data. For that, I need to know in the backend, which user is requesting data. I use the username for that and therefore, I need to send the username as ...
1
vote
1answer
66 views

Snake game MVC (Vanilla JS) - Help separating concerns

I'm making a snake game for practicing the MVC pattern and also going out of my comfort zone (I'm in data processing / data science, mostly procedural coding) The game is available in https://nabla-f....
2
votes
0answers
43 views

Right structure, three-layered architecture webdevelopment

My question is have i gotten the three-layered architecture right with error handling etc. I have a webpage containing different resources. The code works but I am not sure if have structured it ...
0
votes
1answer
84 views

Making a generic web API controller when using multiple tables with similar fields

I have been trying to refactor my code since I found I've been doing a lot of copying and pasting to implement the logic of the web API controllers. Here's how the controllers looked like before ...
3
votes
0answers
238 views

Pomodoro JavaFX (MVC Pattern) Countdown Timer

I made a simple JavaFX app. It is just a Pomodoro timer, it works as expected. The Pomodoro study pattern is a technique where you study for 25 minutes and take a 5-minute break and after 4 periods of ...
2
votes
2answers
94 views

Router and solid principle

I would like to know if my Routing system respects the solid principle ? The system is simple, Router class contains the routes and returns the correct route and Route class represents a route, ...
1
vote
1answer
71 views

An efficient way to order content in controller [Spring Boot]

My code works as intended. CategoryController class has getAllCategories method, which tells ContentOrderMap class to map differently ordered categories to their respective OrderType enum. The ...
1
vote
2answers
164 views

Implementing Pagination with Twig in Codeigniter 3

I am working on a online newspaper/blogging application with CodeIgniter 3.1.8 and Bootstrap 4. I have decided to add themes to it. The application is not HMVC, only MVC. I thought it was a good idea ...
3
votes
1answer
61 views

Filtering database with Linq

I'm building an MVC web app with ASP.CORE 3.1 and EF connected to MSSQL. Today, finally after 3 days, I've somewhat reached a working code for filtering my view. I've got database of Date stamps (15 ...
6
votes
1answer
95 views

Making an alphabatical list grouped by letters

I have a pet project (open source on GitHub) that I built as a learning exercise. It is a lyrics web application built in .NET Core MVC. On the artists page of the site (view on mobile size viewport, ...
1
vote
0answers
36 views

Using HttpServletRequest#getPathInfo or getRequestURI for matching routes in a Router

I'm currently writing on a Router for a MVC framework that will be the core part of my application. The Router is implemented as a Servlet to be registered on any embedded servlet container. In the ...
7
votes
1answer
342 views

Chess application with GUI and AI in Java

I've included the files that I felt were relevant (i.e I haven't included the individual pieces in the inheritance hierarchy). I'm particularly curious as to whether the system as a whole is ...
-1
votes
1answer
77 views

PHP template MVC [closed]

For several days I have been learning about MVC, and I do some code but I don't know if that is correct. I will be grateful for some tips to get this code better. Here is my github respository https://...
3
votes
1answer
201 views

Meme (title with picture) exchanger

Project structure without code: Packages: Classes in packages: In ConfigConstants I store path to folder, where I save pictures. Also in ...
1
vote
2answers
155 views

PHP - How can I refactor this store function (which handles different database operation for user types) in order to reduce duplication?

I'm simply using Slim PHP MVC framework in my API project. PDO::FETCH_ASSOC is used in the database calls. So no data objects. The router handles requests and pass to the controller. controller calls ...
1
vote
1answer
92 views

Is this an good OOP Design in MVC PHP for getting User Details?

I was given a API project by my co-worker to work on half created a system in slim PHP. The project consists of the Models and controllers. When the route is called it calls the Controller with the ...
5
votes
1answer
510 views

PHP OOP MVC structure

I am quite new to the MVC concept. I already know how to program object-orientated from other languages like C++ or Java. I have implemented a little login system for test purpose. I am not sure if my ...
3
votes
2answers
113 views

PHP Edit Volunteer Group Form

I have a PHP CodeIgniter website that collects volunteer registrations. One thing I have noticed is that the controllers are getting really big. The controllers have many methods, and each method is ...
1
vote
1answer
68 views

Improving upon basic MVC in PHP

I've put together a simple CRUD application to keep track of my library of books in an effort to learn the model-view-controller pattern, as well as better myself at PHP. Everything I have works so ...
1
vote
0answers
34 views

**Refactored** Library project

My Solution What I am looking for: DRY Code - in my handleDeleteBook and handleToggleStatus methods I felt that I couldn't find a way to share the id between the methods. Furthermore, what other ...
1
vote
1answer
429 views

feedback needed for my first python tkinter simple MVC, list element to print to label

Just starting to get the idea of MVC with tkinter. I wrote this simple program and I'm looking for feedback. There are no errors, but I don't know if I set it up right or not. ...
2
votes
1answer
573 views

Checks if user is part of Active Directory group

I'm working in C# using PrincipalContext to do a check if user is part of security group for access to the site. Site is asp.net MVC and part of an internal network with security groups set up via ...
3
votes
1answer
479 views

java swing super simple calculator mvc

i am trying to learn mvc (model view controller). there are many texts out there explaining what mvc is. but not many explaining how to actually code mvc. i found a bunch of questions here asking ...
0
votes
3answers
193 views

Filtering data from MYSQL database based on parameters passed with POST request

I am working on a PHP MVC project for my portfolio. Its an web app where you can store contacts (email and phone number). I am having trouble with filtering contacts based on filter form that has 3 ...
7
votes
1answer
252 views

Gem Puzzle game

I started learning JavaFX a few days ago and I have just created as an exercise a simple Gem Puzzle game. The puzzle pieces can be moved if we click on them. The visual aspect of the game is very ...
3
votes
1answer
102 views

MVC pattern in my Repair Shop application

I am currently learning Java programing by building real life business application for repair shops. I am posting this code so I can get critical review, and change my application architecture if ...
6
votes
1answer
87 views

Mvc design for FTP Client

This app will be a FTP desktop application meant to transfer files between a server and a client, pretty much like Filezilla, there is no server code to show as I will not implement Network features ...
0
votes
1answer
63 views

Improving PHP MVC code for personal website [closed]

Github for project: https://github.com/wrpd/portfolio I have a very general understanding of MVC but haven't ever implemented it. In an effort to improve my understanding and get back into a little ...
7
votes
1answer
723 views

Properly Structuring a Tkinter Application

I'm fairly new to object oriented programming and while I understand the basic concepts, I'm still having some trouble organizing my applications. I'm building a small Tkinter application as a ...
5
votes
1answer
162 views

Java program to encrypt/decrypt text

I am working on adding a GUI to the project that I was making in some course. I am curious if the layout looks good, if there variables and methods are shared properly between particular classes, if ...
4
votes
1answer
309 views

Codeigniter 3 micro-blogging application

I am working on a basic blog application in Codeigniter 3.1.8 and Bootstrap 4. The application allows Registration (as an author), Login, adding Categories and Posts. I have created an installation ...
4
votes
1answer
2k views

PHP MVC render view method

I am working on creating a simple MVC inspired framework (for learning purposes and because i don't want to use a pre-existing framework at the moment). I have the system already set up and its ...
4
votes
2answers
55 views

Simple wiki with PHP, part two

Following up from part one, I've attempted to convert the largest part of my project into an MVC pattern as per suggestions from the accepted answer. I've managed to split the original ...
1
vote
1answer
106 views

Simple wiki with PHP

I'm attempting to create a basic wiki for personal use. I've got a pretty good start, but the code is beginning to become cumbersome to modify, and some of the things I'm doing feel very fragile. I've ...
1
vote
0answers
115 views

Rails dynamically changing parts of view but using the same method in controller

I have this update method which decides whether to update or recreate(same as update but resets the approval_status and create_date) of the building_approval object. I have the on_progress? method on ...
2
votes
2answers
538 views

MVC Java console tic-tac-toe

...
4
votes
0answers
65 views

MVC Controller Error & Exception Handling .NET Core

I'm putting together a basic web app in .NET core 2.1 MVC to try and better understand how it works. Currently I'm working on returning validation to the UI. Once I have this working I then want to ...
1
vote
0answers
174 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
684 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 ...
2
votes
1answer
242 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
480 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
713 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
vote
1answer
55 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
48 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. ...
4
votes
2answers
2k 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 ...
3
votes
1answer
166 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
229 views

Python (Sanic) Routing

I 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 - Returning controller ...

1
2 3 4 5
11