Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [mvc]

MVC (Model-View-Controller) is a software architecture pattern that enforces separation of concerns.

Filter by
Sorted by
Tagged with
0 votes
4 answers
180 views

How to eliminate repetition in three subclasses: each defines an identical method that does almost the same thing, but with a different return type

TLDR: I have three subclasses, each inherits from the same parent class, each defines an identical method that does almost the same thing, except that each of these methods has a different return type....
thatUserHOverThere's user avatar
0 votes
0 answers
44 views

Where to add WebApi in a service repo design pattern project?

I am hoping someone has had to do this before and can help. I have a multi tier MVC application that I need to add WebApi, in preparation for moving to .Net Core + react and a new set of controls for ...
QubeSimon's user avatar
0 votes
0 answers
23 views

An IoT client and MVC-based server. Data model with different fields per type?

The problem Let's assume such scenario: List of IoT devices (one model?) Each list item has (among other fields) a type field Depending on the value in the type field, device may report different ...
trejder's user avatar
  • 2,396
1 vote
1 answer
175 views

Implementing MVC in C++ with minimal boilerplate despite lack of reflection

Powerful reflection capabilities make implementing nice architectural design patterns such as MVC and Dependency Injection very simple in languages like Java and Kotlin. In particular, reflective tags ...
The_Sympathizer's user avatar
0 votes
2 answers
114 views

Do I use a model or controller in an existing MVC application for implementing an integration that makes API calls?

I have an existing application using Codeigniter Framework (MVC). I need to implement an integration in the software with the external cash register (e.g., making REST API calls). I need to either ...
objecttothis's user avatar
0 votes
1 answer
75 views

Creating Controllers and Repositories without corresponding Models

I have to create a system to interview people on a few topics where they have to answer both objective and discursive questions, where questions may change between interviews. I structured the ...
Akari Oozora's user avatar
-2 votes
1 answer
86 views

what are MVC benefits for my case?

I'm trying to design my new open source project I want to launch. I want to be very careful with design/projecting because I had trouble maintaining software in the past. I have code that works and ...
gabrielsalvador's user avatar
0 votes
3 answers
389 views

What is the difference between these two MVC diagrams?

I want to understand what is the main difference in these two diagrams when it comes to the Model-View-Controller pattern. If there is a difference, how should I choose to construct my program? What ...
codertryer's user avatar
0 votes
2 answers
57 views

In which layer request parameter limit should be for an external endpoint?

I have a batch endpoint of the form POST /entities ["id1", "id2", ...] Where the endpoint takes an array of ids and returns a batch response. Now I want to set a maximum value to ...
Aiono's user avatar
  • 200
1 vote
0 answers
83 views

ASP.NET MVC use ViewModels with Services

I'm trying to make a simple Blog-application, but I'm a bit stuck on the architecture of the application. I'd like to create a details-page with the content of the blog-post and a form for adding ...
Sam's user avatar
  • 65
5 votes
4 answers
461 views

Does my outer class adhere to the Single Responsibility Principle?

I often write front end apps with a generic MVC pattern. I use javascript but this questions is language independent and relates to OOP as a whole. I struggle to understand the SRP principle and I ...
Kevin Greetham's user avatar
1 vote
1 answer
497 views

Is this a good example of what a service layer is in MVC?

I am wondering what a service layer is in MVC. I like to understand concepts through a game of monopoly as it's relatable to a lot of people and fairly easy to explain whilst allowing for some good ...
Kevin Greetham's user avatar
0 votes
2 answers
286 views

How can I achieve polymorphism if MVC logic is on the controller?

First, let me start by saying I’m a JavaScript developer but any conceptual advice I’d imagine is identical if not similar to when dealing with MVC. During my learning, I stumbled across MVC and now ...
Kevin Greetham's user avatar
0 votes
1 answer
151 views

How to decide what view to show if I use polymorphism in the Model?

I am making a game of Monopoly. I call a method in my Board class which returns the current players square object! E.g Old Kent Road. Euston, Chance , Free parking. I use polymorphism to decide upon ...
Kevin Greetham's user avatar
0 votes
1 answer
342 views

Multiple models/controllers python app

I am trying to tinker with the MVC pattern and I have a problem when trying to design the MVC structure. I need a model for products, however as I need to manage more and different data, I can help ...
Eideann's user avatar
  • 13
-1 votes
1 answer
67 views

Does it make sense to create seperate data application layers that interact in asp.net mvc?

I work with csv files that after some steps provide the initial data, and with a database that is derived from this data. The database then is read from and written to in many different ways by the ...
Miles's user avatar
  • 101
0 votes
1 answer
104 views

Benefit of using Dependency Injection inside ASP.NET Core MVC

I am reading this article about using DI inside ASP.NET Core @ https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-6.0 .. but i can not understand its ...
test test's user avatar
0 votes
2 answers
676 views

Is MVC a sensible design choice for a CLI application?

I am working on a CLI chess game that only involves 2 human players, I decided to make it follow the MVC architecture to ensure separation of concern and to make the possibility of a GUI/web ...
Yoh's user avatar
  • 51
2 votes
1 answer
105 views

MVC: Should View get strings of GUI components directly or should the controller pass strings to View?

I have an MVC application in Java with GUI components in a View class. The GUI has to support two languages, so texts on buttons etc. depend on which language was set at start up. Strings are in ....
Samil's user avatar
  • 131
0 votes
1 answer
77 views

I don't understand how to characterize a class similar to a DTO but with validation

I have the entity class. @Entity public class User { @Id @GeneratedValue private long id; private String name; private String lastname; @Column(unique = true) private ...
CalmPerson's user avatar
-1 votes
2 answers
139 views

How to make domain objects accessible to MVC controllers and views?

Summary of my question in a short form: How to propagate changes of domain objects upwards without introducing application logic into them? Following 'facts' are based on prescriptions from respected ...
reign's user avatar
  • 125
0 votes
0 answers
443 views

Spring Boot: Best approach for aggregating DTOs over multiple services

I have the following situation in my spring boot application: I use unidirectional relationship modelling for my database entities, in order to prevent difficulties with a bidirectional approach. (...
msts1906's user avatar
0 votes
1 answer
556 views

Validation in both controller and my service classes?

I use the Laravel framework. I've got controllers, like CustomerActivityController, and I've got a service layer with services like CustomerActivityService. Say I want to create a new customer ...
user2190492's user avatar
-1 votes
1 answer
349 views

MVC for interaction between two models

Maybe a repeated question, so you all could link me if you know an older answer. I'm creating a small web application, using MVC, for a volunteer project that I participate. Right now I'm doing a ...
Luis Antonio Momm Duarte's user avatar
1 vote
2 answers
412 views

MVC-like architecture: Model-Controller communication of results/status

I'm struggling on designing a solid architecture for my project. In particular, I don't know how to handle the communication between the models and the controllers. My goals are: Following the ...
yes sure's user avatar
3 votes
0 answers
758 views

MVC vs Layered vs Client-Server

On this book (Software Architecture, 10th Edition by Ian Sommerville, ISBN: 9781292096131), the following architectural patterns are presented (Chapter 6, 6.3, p175): MVC Layered Client-server ...
pmdci's user avatar
  • 169
2 votes
1 answer
738 views

In an MVC Application, What Goes Where?

In an Model-View-Controller (MVC) design pattern, What goes where? What code goes to model and to controller? I know (do I?) that business logic should be define in a model, but a lot of example I ...
careLess's user avatar
0 votes
2 answers
2k views

Who is the Observer in MVC? Controller or Views?

Implementing the Observer pattern in MVC could mean making Model Observable and View Observers. However, this also means that there will be direct communication between views and models without the ...
a_fan's user avatar
  • 145
-2 votes
1 answer
48 views

Does Angular (or other frontend framework with auto UI update) break Single Source Of Truth since using function within template should be avoid?

I know when building an Angular app (or other frontend framework with auto UI update by change detection), using function in a template is not recommended since it will result in the function being ...
Ricky Mo's user avatar
1 vote
2 answers
410 views

Model updating itself in MVC?

My group in school is tasked with creating an application of our own choosing which follows good object oriented design principles. The group has chosen to make a tower defense game with help of ...
Felix Jönsson's user avatar
0 votes
2 answers
92 views

Where to sync Database and Search-Database in MVC pattern

I have a website-sideproject (Application Server: Django, Database: sqlite) with "search" functionality and I've recently stumbled over this problem. When you have a full-text-search-...
Philipp Doerner's user avatar
0 votes
1 answer
93 views

How best to structure this MVC or Razor Pages web application given a required tcp/ip server data source that acts like a web api?

I am rewriting an old asp.net 4.0 web forms website that exposes an application's data and logic to the web. I am moving this to a .net core mvc or razor page project. The website has minimal ...
Zevias's user avatar
  • 9
1 vote
2 answers
111 views

How to properly implement Rest Controllers to handle overlapping entities?

I have: A User entity. A Poll entity. Relationship: User creates polls. Use-case: When an arbitrarily user is clicked his/her profile is loaded and shown. The profile includes a list of polls ...
Julian Broudy's user avatar
-1 votes
1 answer
96 views

Client side validation with Jquery - MVC C# app

I am working on a very LEGACY MVC App using C# which is built from 2009. They dont have any client side validation at all. In other words, they dont use Validation mechanism provided by MVC framework ...
NinjaCoder's user avatar
4 votes
2 answers
2k views

Why do backend web frameworks use "MVC" when they have no persistent UI to update?

Model View Controller (MVC) is focussed on UI based applications. In MVC the model notifies the UI (view) when its values change and the view then decides what and if to update. I can understand this ...
Eoin's user avatar
  • 319
8 votes
1 answer
8k views

The right place for "app logic" in MVVM context

I hope this is the right place to ask. I'm an experienced developer, and have used MVC for much time. This question is in the context of iOS/macOS development for the most part, (SwiftUI). Using MVC ...
Woodstock's user avatar
  • 191
0 votes
3 answers
221 views

How best to structure my Service/Repository layers when persisting a Many to One object?

I'm working on a project where I need to do CRUD operations on Book and Library objects. Naturally the relationship between Book and Library is Many to One, like so: @Entity @Getter @Setter @...
hfg124g76g1's user avatar
2 votes
1 answer
2k views

How to do MVC in C++

I have a QT application with a window of OSG written in C++. I want to implement the app using MVC design. The application allows you to add markers to OSG model and it is using QT to edit the markers....
jacob galam's user avatar
1 vote
1 answer
639 views

What would the database schema look like for a Entity Component System architecture of web app?

I found previous SE questions like this. I'm familiar with the typical RDBMS backed MVC web app framework. To illustrate what I am thinking of, let's use the examples of Bunny and Carrot from this [...
Kim Stacks's user avatar
2 votes
2 answers
324 views

MVC: Should my domain model look like this?

Consider the following GUI screen (Java Swing) with a list of persons where the user can select a person and delete it. According to MVC, the view observes (observer pattern) the model and updates ...
George Z.'s user avatar
  • 705
0 votes
1 answer
84 views

In an MVC desktop application, is there a canonical solution to share an immutable value class between multiple components?

Question In the context of an MVC, desktop architecture, is there a canonical solution or a design pattern / best practice to give access to an immutable value class to multiple components at ...
orangeBall's user avatar
1 vote
1 answer
704 views

MVC architecture - communication between nested components

I'm working on a rich client desktop application. I'm trying to use MVC to decouple the model, view and controller responsabilities. Problem is I can't seem to find a clean solution for handling ...
orangeBall's user avatar
3 votes
3 answers
1k views

RESTful endpoints for returning same model based on different fields?

What is the recommended convention to be followed for identifying different GET endpoints that fetch the same model/entity using different fields/parameters? For example, there is a Student entity for ...
Tabish Mir's user avatar
2 votes
2 answers
3k views

Should a single method in a service class perform multiple operations for its controller?

Let's say I have a controller called MessageReceiverController which is a controller of an API that other services can call and include messages in the requests. For each of the messages the ...
xenon's user avatar
  • 887
5 votes
2 answers
2k views

Clean Architecture, how does the use case interactor generate different outputs?

I'm trying to understand how do controller and presenters work in clean architecture projects and could use some help. Specifically about generating multiple outputs from the use case. In the Clean ...
Diego Rodriguez's user avatar
3 votes
1 answer
389 views

DRY principle vs decoupling (business from GUI)

Say I have a business model called Vehicle. Vehicle has many fields but to keep it simple say it looks like: public class Vehicle { String ownerName; String brand; FuelType fuelType; }...
George Z.'s user avatar
  • 705
0 votes
1 answer
166 views

Monolithic view model MVC

Currently working on a legacy app. One section deals with generating "reports", each which share some common subsections, that are based on strongly-typed razor partial views. The largest ...
Lovethenakedgun's user avatar
1 vote
3 answers
394 views

Is creating an entity in a database considered to be business logic?

According to my (perhaps incorrect) understanding business logic includes saving/updating entities in the database, as well as connecting with any 3rd party API's or using services and should ...
Yos's user avatar
  • 157
1 vote
1 answer
534 views

In which layer should I load views on a Clean(ish) architecture?

I am trying to organize my architecture following the clean architecture while using some common practices/frameworks. I'm writing in PHP, but have no problem with other languages. The flow of my app ...
Erick de Azevedo Lima's user avatar
2 votes
2 answers
581 views

Difference Between MVC and MVC + 3 Layered Architecture?

I haven't been able to find a definitive answer online, so I'm hoping that someone with experience can help answer this. Many MVC tutorials I find online end up using the MVC architectural pattern as ...
Mixed_Signals's user avatar

1
2 3 4 5
20