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
1 answer
34 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 ...
user avatar
-1 votes
2 answers
59 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 ...
user avatar
  • 25
-2 votes
0 answers
53 views

What rules are there concerning the parts of the MVC pattern?

(I'm new to Stack Exchange's Software Engineering forum/website. I've got a question about the MVC software pattern used in frameworks like Microsoft's ASP.NET. If this is the wrong place to ask this ...
user avatar
  • 149
0 votes
0 answers
41 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. (...
user avatar
-1 votes
0 answers
32 views

Integration test for java based command line tool

I am working on a Java-based command-line tool that interacts with many services and returns results back on the terminal. Going forward I want to deploy this command-line tool as a java microservice. ...
user avatar
  • 1
0 votes
0 answers
48 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 ...
user avatar
-1 votes
1 answer
52 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 ...
user avatar
1 vote
1 answer
280 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 ...
user avatar
3 votes
0 answers
220 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 ...
user avatar
  • 149
2 votes
1 answer
172 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 ...
user avatar
-1 votes
2 answers
178 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 ...
user avatar
  • 135
-2 votes
1 answer
42 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 ...
user avatar
0 votes
0 answers
57 views

Scaling Docker Containers Question with .Net Core Worker Services

I have a fairly what I think is simple question but am completely unfamiliar with design considerations when using docker containers. So I have been trying to come up with a structure for an app that ...
user avatar
  • 101
0 votes
0 answers
16 views

Consume Identity enabled WebApi in an MVC Project

I have an MVC project with no authentication. The project uses webapi as a backend to retreive and send information through the controllers. Now we need to add authentication to the webapi project as ...
user avatar
1 vote
2 answers
193 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 ...
user avatar
0 votes
2 answers
49 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-...
user avatar
0 votes
1 answer
40 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 ...
user avatar
  • 9
1 vote
2 answers
60 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 ...
user avatar
-1 votes
1 answer
38 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 ...
user avatar
3 votes
2 answers
602 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 ...
user avatar
  • 219
3 votes
1 answer
3k 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 ...
user avatar
  • 141
0 votes
1 answer
62 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 @...
user avatar
2 votes
1 answer
838 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....
user avatar
0 votes
1 answer
296 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 [...
user avatar
2 votes
2 answers
169 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 ...
user avatar
  • 695
0 votes
1 answer
43 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 ...
user avatar
0 votes
1 answer
155 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 ...
user avatar
3 votes
3 answers
267 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 ...
user avatar
1 vote
2 answers
760 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 ...
user avatar
  • 887
3 votes
2 answers
831 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 ...
user avatar
2 votes
1 answer
193 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; }...
user avatar
  • 695
0 votes
1 answer
98 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 ...
user avatar
1 vote
3 answers
215 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 ...
user avatar
  • 145
1 vote
1 answer
247 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 ...
user avatar
1 vote
2 answers
313 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 ...
user avatar
-1 votes
1 answer
91 views

Is State Considered Part of Model In Desktop MVC?

Most of the answers I see that discuss what the model layer is comprised of, only address stateless MVC, particularly ASP.NET's implementation of it. When working with desktop MVC frameworks such as ...
user avatar
4 votes
1 answer
165 views

Do Domain Objects Have To Be Persisted?

Does a domain object have to be persisted, or does this violate some convention about domain objects? For example, let's say I'm using an object called AuthenticationState to represent authentication ...
user avatar
1 vote
2 answers
78 views

How to provide error details back to REST request?

In an ASP.NET MVC 4 REST API application, we have SQL errors which are occuring during the request. However, since the requests are big, we are streaming the data back to the client, which means we ...
user avatar
  • 29
1 vote
1 answer
112 views

How does one-way data binding and MVC achieve loose coupling?

In my limited understanding, one-way data binding could happen like the following: On the back-end, I have a Node backend server. In that, I have a layer that communicates with the database (Model). I ...
user avatar
  • 21
3 votes
1 answer
384 views

ASP.NET MVC Caching of ViewModels

My question is regarding caching and ViewModels in ASP.NET (Core) MVC. I have a service which injects a Repository<T> which is used to fetch domain models from the database. The service layer ...
user avatar
  • 139
-3 votes
1 answer
731 views

Comparison of CQRS and MVC

Command Query Responsibility Segregation and Model–view–controller patterns look pretty similar to me. Are they comparable? Do they act at the same layer of abstraction? How do they differ? Can they ...
user avatar
  • 133
2 votes
1 answer
183 views

In an MVC-patterned app, how should one build the interface between model and user interface layers to work nicely with threading?

I am wondering about this. This is a sort of follow-up to my last question here: In the MVC pattern, what has the responsibility for creating the view? because now I've run into the question of how to ...
user avatar
2 votes
1 answer
314 views

In the MVC pattern, what has the responsibility for creating the view?

This is something that has been bugging me for a bit in a program I am trying to build. It is a desktop GUI application, and I settled on the use of the famous "MVC" (Model-View-Controller) ...
user avatar
1 vote
0 answers
94 views

Rest API backend and React frontend is MVP?

I'm doing a website that has a React frontend that calls some RESTful API and I would like to know if this is an MVP pattern. I think that the React application implements the View and the Presenter, ...
user avatar
0 votes
1 answer
65 views

How to inform the controller why the object creation has failed so an appropriate response can be returned?

In my MVC web application the controller calls a service layer which takes any relevant request parameters and builds the model for the view e.g. Controller var model = _modelService.Build(id); return ...
user avatar
  • 103
7 votes
4 answers
1k views

In MVC, is the router considered one part of the controller? Or are they considered separate entities?

I'm learning to implement RESTful APIs, and the concepts of Controller and Router are common in many frameworks, along with the MVC pattern in general, so I'm encountering them everywhere. From this ...
user avatar
  • 208
1 vote
0 answers
66 views

Issues Regarding Data Model Abstraction in Golang

I am currently writing a quiz web-app with a React front-end and a Golang backend, with a PostgreSQL database to keep track of the quizzes, the questions on the quizzes, and the choices in the ...
user avatar
4 votes
1 answer
199 views

MVC Patterns: Is There a Design Pattern For Returning Lists (Arrays) of Complex Entity Objects?

I’m struggling with how I should build out my entities, services, and DAOs in an MVC web application when it comes to returning a list (array) of data. On one hand, returning an array of entity ...
user avatar
  • 149
0 votes
3 answers
207 views

OOD vs MVC; Live Objects vs Everything in Database

How to make memory-efficient code, but still have all the possible code nicely encapsulated ? I have a feeling that the OO (object oriented) approach is more intuitive and the code is nicely ...
user avatar
-2 votes
1 answer
61 views

Is there a less complicated alternative to handling this simple mySQL query in Node?

To Put My Question In Better Context... I am about done writing my first real-world Node application, which would be classified as a REST API. For myself, it was a bit challenging to wrap my head ...
user avatar
  • 99

1
2 3 4 5
19