Questions tagged [mvc]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
67 views

is the logic defining how the data should be converted in different formats, presentation or business logic?

In a calendar app adopting a MVC architecture, the Model consists of objects representing the days of the week. The View consists of labels displaying the days as strings or integers, depending on ...
user avatar
  • 295
7 votes
4 answers
438 views

Should the "model" part of MVC deal with the internationalization layer?

I have seen this done in some applications, and it's not clear to me that this is ok or if it's a separation of powers violation.
user avatar
-1 votes
4 answers
643 views

At what stage of a Java project do you configure GUI components?

I need a little advice with project design. I have taken on a personal project to enhance my knowledge of Java Swing, API integration, JDBC and OOP I have chosen to do this in Java as I previously ...
user avatar
  • 19
13 votes
1 answer
16k views

How can I apply the MVC pattern to a C# WinForms application?

I'm a C++ developer who has been using the MVC pattern to design GUIs ever since. Recently I wanted to get back into C#, and I set up a Windows Forms application, but now I am a little bit lost on ...
user avatar
2 votes
2 answers
3k views

Can not understand how dependency injection can ease testing inside asp.net MVC

Each time i read an article or a book about asp.net MVC , there will be a chapter for dependency injection and repository . now i can easily feel the benefits of using repository over hard coding the ...
user avatar
  • 209
1 vote
2 answers
917 views

Is it bad practice to have lots of Models Views and Controllers?

I'm designing a system at the moment using MVC (with Laravel, if that matters) and I'm trying to decide how best to architect a part of it. An an analogy, you could look at it like this: There's ...
user avatar
2 votes
1 answer
618 views

Good analogy for MVP and MVC patterns?

To be honest, I'm a student here, but I have seen many questions from teachers asking for ways to explain, and I have not found one for the MVP and MVC patterns. Model–view–presenter Model–view–...
user avatar
1 vote
1 answer
117 views

In an MVC software, where should the logic of the functions which manage connections go?

I'm developing a C-based software in which I want to use a Model-View-Controller approach, and while I think I quite got into the style's rules, I don't really understand where should I place the ...
user avatar
3 votes
1 answer
24k views

What will be the best practice to handle duplicate entry in DB in Spring MVC, throwing Exception or other way?

I am currently working a School Management project using Spring stack, Kotlin as programming language and Neo4j for storage solution. Here is the scenario, I am creating a Class entry in the DB. ...
user avatar
2 votes
1 answer
293 views

Architecting a DAM with MVC framework

I'm familiar with OOP and PHP, but I'm new to MVC frameworks. I'm currently using Laravel and have found it wonderful so far, but things have gotten trickier as I've progressed, and now I realise I ...
user avatar
0 votes
1 answer
121 views

Models of models of models in MVC

Currently working on an accounting application. Wrote the GUI framework from the ground up with Win32 and it works well. The issue I'm having is trying to separate the GUI from the application logic. ...
user avatar
  • 1,159
1 vote
1 answer
81 views

Splitting up method in base class to avoid errors if developer forgets to call parent: a good idea?

The create and update methods in my model base go through a few steps: pre_save, udpate_database, post_save. The pre-save and post-save are specifically designed to help with object-relational ...
user avatar
0 votes
1 answer
93 views

Should a home page linked to two models have two controllers?

I'm working with an MVC framework to build a simple Q&A web app, and I am trying to grasp the idea of controllers acting on the app. For instance, say I have a home page with the following links: ...
user avatar
1 vote
1 answer
208 views

Design Patterns for drawing a custom graph in a webapp

I am building a web application which is meant to help display prices of products. The web-app is centered around showing prices in a custom bar chart. I am thinking it should be composed of a Model ...
user avatar
1 vote
1 answer
686 views

MVC pattern + ( REST) View Confusion

I have been trying to build an MVC structured RESTapi.Since it's going to return JSON only,is it right that my View will just have a header and that the view will output the JSON also? I planed to ...
user avatar
  • 159
0 votes
2 answers
509 views

Designing workflow processing and callbacks in multilayer asp.net application

I am looking for a design advice for the following scenario: Three layer application: MVC Portal (just frontend app really) Business logic WebApi (all the magic happens here) Connected services (...
user avatar
  • 597
6 votes
4 answers
266 views

Storing directly in the model

Normally when I have some data to store, I do something like Model model = new Model(); Notifier notifier = new EventBus(); Store store = new DataStore(); model.updateTitle("new title"); store.save(...
user avatar
  • 103
1 vote
2 answers
607 views

MVC: how to design interface for database

I'm a newbie on web development and I've heard about MVC. If I'm right, it's the Controller that take charge of fetching data from DB. So I have a question: In the pattern MVC, how many objects to ...
user avatar
  • 211
0 votes
1 answer
106 views

MV(X) Patterns: How much nesting is too much? Is not enough?

Posts may be smaller than they appear! Skip the bulleted list. Lemme Just Say... I know that this is going to be largely (entirely...) opinion-based. Everyone has their own approach, and their own ...
user avatar
  • 259
1 vote
1 answer
46 views

MVC: In iOS how to pick a view and then apply a suitable controller to it?

Per MVC design pattern as in GOF, "a view can be disabled so that it doesn't accept input simply by giving it a controller that ignores input events". That means, we decide a view first and then pick ...
user avatar
  • 397
7 votes
4 answers
1k views

Any reasons for DTO (ORM autogenerated stuff) model used as ViewModel?

I've encounter yet again this situation where programmers are using autogenerated models (from LinqToSql, EF, nHibernate, whatever) as view models. Usually the architecture is very simple : Some ...
user avatar
0 votes
1 answer
67 views

What is the correct way to design a model and its relations?

I have the following database models and its properties: User (id, role_id, name, email, password) Role (id, name, description, active) User2Role (user_id, role_id) Customer (id, name, user_id) A ...
user avatar
  • 1
2 votes
1 answer
305 views

MVVM, example of use in iOS

I have a view controller with a mapview (Apple Map), on top of that there is a view with a button and a textfield. The view is compacted around the search button, when I touch it it expands revealing ...
user avatar
  • 133
6 votes
1 answer
16k views

How to model user management using UML class diagram?

I have school project where me and my team have to build a health care system. It consists of different modules including : A module for doctors : It allows a doctor to access the medical records of ...
user avatar
0 votes
2 answers
162 views

Which End should start first? (MVC)

I am developing a small application and trying my best to make it as professional as possible in regards to design pattern etc. It is a JavaFX app, and my app works fine but I am uneasy at the fact ...
user avatar
  • 179
1 vote
1 answer
581 views

Using Dependency Injection with (user) data heavy application

I have a large-ish application which's purpose is to aid the user in designing and analysing multiple configurations of Battle Mechs in Mechwarrior: Online. The curious can find the source here. ...
user avatar
  • 322
1 vote
1 answer
70 views

In an existing web app, how do I introduce restricted access to groups of users?

I'm working on a large web application. Users are organized into Companies, then Roles, and then possibly Teams or are individual users. For example, Bob is a member of Company A, has the Officer ...
user avatar
1 vote
2 answers
160 views

MVC design. Appropriate Connections

OK... I am attempting to implement a simple MVC windows application... There is a helper class (ConvertPDF) that is instantiated by the Controller. As it is currently implemented, the Converter ...
user avatar
  • 19
4 votes
2 answers
593 views

MVC : In MVC pattern, when and where is the Model created?

Let's say I have an application which eventually saves and retrieves it's data to/from DB. For the sake of explanation let's imagine the application deals with students. I have a complete API that ...
user avatar
5 votes
2 answers
337 views

Is MVC Sane to call a Model through Zend Framework's ViewHelper

Recently I debated with a colleague of mine about to the following issue: I claimed that it is not MVC sane and good practice to directly load a Model via Zend Framework's ViewHelper because it is a ...
user avatar
3 votes
2 answers
205 views

Several models for one entity

I use a traditional MVC pattern for my web projects: Controllers: handle use case scenarios steps (can call business logic in models or services) Views: presentation Models...... I hit a wall with ...
user avatar
0 votes
1 answer
90 views

Designing a model

I'm a PHP developer, and what do PHP developers do? They create frameworks, so I'm having my way with my little mvc framework project and I've stumbled across a design problem I'd like some opinions ...
user avatar
  • 2,174
0 votes
1 answer
612 views

How should I divide up classes in an MVC application?

I'm going through Apple's Start Developing iOS Apps (Swift) tutorial and I'm confused on how they are using MVC. They have a custom control (the view, a subclass of UIStackView), it is basically 5 ...
user avatar
  • 181
1 vote
0 answers
363 views

Getting a route from MethodInfo in ASP.NET Core

Is it possible that given a MethodInfo object, i can somehow figure out what the MVC registered route would be for that method? I've tried something along the lines of checking if the MethodInfo has ...
user avatar
1 vote
0 answers
78 views

How to follow MVC in a standard iOS App theoritically?

I want to understand one thing in plain english that how do I actually use an standard MVC design pattern in iOS App. I know about Modal View and Controller and theoretically I know what they do(...
user avatar
2 votes
1 answer
750 views

In MVC, should pure View events be handled in the Controller?

Let's say I have a form with a black label. I have a button that is supposed to change the label color to red. This functionality has nothing to do with the data layer (the Model), but only with the ...
user avatar
1 vote
1 answer
116 views

What are approaches for building more robust Ajax applications without using AngularJS

Within a Java shop, we are using Spring MVC, some HTML output and some JSON/Rest output as a service. Our client side is more familiar with jQuery for ajax messaging to the server. We have been able ...
user avatar
-1 votes
1 answer
137 views

What can we call a model, controller, and related views? [closed]

When developing an application using the MVC pattern, I often find myself adding a new model, a new controller, and a new set of views for the actions in the controller. These changes are pretty ...
user avatar
4 votes
2 answers
2k views

is it bad practice that controller call domain objects(entities) direclty instead of service?

is it bad practice that controller call the methods of domain objects directly instead of service? to explain more: I figure out that in good design controllers call service and service use Domain ...
user avatar
  • 396
6 votes
0 answers
115 views

Intuitive dependency management with code includes?

I am building a PHP CMS system that parses template files and replaces tags with content. Sometimes this content is a HTML, CSS or JS snippet, but it can also be a code include. Most code includes ...
user avatar
  • 223
1 vote
1 answer
1k views

Web API & MVC Website - IdentityServer4

I am having trouble understanding the purpose of everything I am trying to do here. I have web api, mvc, and angular2 project linked by authentication provided by identityserver4 As in, why would I ...
user avatar
  • 111
1 vote
2 answers
274 views

Is it a good practice to load Models as a service like I do when I use Symfony framework?

Usually on Symnfony framework I use the provided depedency Injection container and on Controller I load the models as a service. To be more In detail on a current project I am having the following ...
user avatar
1 vote
1 answer
76 views

Is it a good idea to Use a Status Model in order to communicate From Model to controller via MVC?

During development with MVC I figured out this Architecture (based on Symfony Framework but I need to apply it more generally on MVC Pattern base software): In other words each model is a Facade of ...
user avatar
0 votes
1 answer
1k views

Template Method Pattern and Dependency Injection on an MVC view

I worked for a client a number of years ago (who I won't name to protect the guilty) that would periodically have information like the following in their View logic: if (client == "a") { // ... } ...
user avatar
1 vote
0 answers
164 views

MVC remote validation approach

I have a model, the model has 2 strings; foo and bar. foo is what it is, it will be one of x amount of possible values (it's not an enum, though). bar is entered by the user, so I want to validate ...
user avatar
2 votes
1 answer
1k views

MVC as Architecture Patterns

When I want to design architecture of system in diagram, I usually take some architecture patterns and give them the system identity. For example, a simple system for school management with Layer ...
user avatar
  • 137
3 votes
1 answer
277 views

Is it always optimal to preserve encapsulation in MVC?

I've just finished up a project in which I created a visual simulation of the life cycle of an ARM instruction in a single cycle processor. I used the MVC pattern in this project and ran into a design ...
user avatar
2 votes
1 answer
157 views

Correct Design Choice for Maintaining "static" View Across Multiple Controllers?

First, I am not sure if I'm asking this within the correct Stack Exchange community, so if this question belongs somewhere else, please let me know. It didn't seem appropriate for Stack Overflow. I ...
user avatar
  • 123
5 votes
1 answer
16k views

How to implement the MVC design pattern with JavaFX written in pure Java

I am currently in middle of designing a backup application in JavaFX written in pure Java (meaning without Fxml) . I am having trouble implementing the MVC pattern for the following reason. The way I ...
user avatar
  • 1,539
5 votes
2 answers
3k views

Pattern for a method call outcome

Most often I need to call a service method from a controller, and based on the outcome, if there's an error show an appropriate error message depending on the error (or some other action, showing ...
user avatar
  • 1,129

1
3 4
5
6 7
19