Skip to main content

Questions tagged [mvc]

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

0 votes
1 answer
112 views

Where to put getOrSave responsibility?

I have many repeated parts of service logic which just fetches object if it exists or returns a newly saved one. I want to move it from service because it just clutters up the logic. But I do not ...
DimitrijeCiric's user avatar
0 votes
4 answers
184 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
58 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,406
1 vote
1 answer
180 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
153 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
78 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
88 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
410 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
59 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
96 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
482 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
522 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
300 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
159 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

15 30 50 per page
1
2 3 4 5
64