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

learn more… | top users | synonyms

12
votes
4answers
491 views

Why is it the caller's responsibility to ensure thread safety in GUI programming?

I have seen, in many places, that it is canonical wisdom1 that it is the responsibility of the caller to ensure you are on the UI thread when updating UI components (specifically, in Java Swing, that ...
1
vote
0answers
9 views

Refactor presentation logic from model

I've seen this pattern used in a considerable amount of MVC applications. Let's assume we have a User model with the methods: hasSessionExpired displaySessionExpired The first method ...
0
votes
1answer
107 views

Validate polymorphic votes - Controller or Model?

I have a question because I don't want to do something wrong. I have a polymorphic relation called votes. Well, I want to save votes but I need to validate if a user already has voted. But even if, ...
3
votes
1answer
51 views

MVC Advanced Permission System Patterns [on hold]

I'm familiar with role and activity based permissions, but I'm curious about patterns that go beyond the basics. In particular, I want permissions to be granted based on the user's relationship with ...
0
votes
0answers
43 views

What's the accepted way of communication between two model objects in MVC?

I have a model object that fetches data through an URL connection, and another model object that stores and parses it. Eventually when the data is ready, a key-value observing notification is ...
0
votes
1answer
76 views

JEE MVC, controller calls the interface instead of the interface implementation

I'm following this tutorial: http://wiki4.caucho.com/Building_a_simple_listing_in_JSP It creates a basic web application in Eclipse using the MVC pattern with Resin as the web container. Here's the ...
2
votes
2answers
373 views

Sharing code logic between controllers, through the Model layer?

As I originally conceived my Model layer, it was only supposed to hold data and no code. I receive DTOs from web-services, they are mapped into my Model objects. Those model objects usually end up ...
-1
votes
0answers
57 views

Design pattern for user-roles on MVC, following SRP [closed]

I'm working on an application with 3 types of roles. Some roles may view the same data, and perform the same actions; but also differ in some other view or actions. Following SRP, I'm used to see a ...
0
votes
1answer
69 views

MVVM model vs viewmodel

I am trying to wrap my head around MVVM and "models should not have behaviour". If my getter depends on an environment variable, should it be in the model or viewmodel? Does it make a difference if ...
1
vote
1answer
647 views

MVC URL structure with URI parameters

When creating routes for your MVC web application I have seen two possible ways to pass variables to a controller method: With the first approach the variable is passed to a parameter of the ...
6
votes
1answer
136 views

UI Design patterns for non-screen based project

I'm working on a small project coded in Python that uses a single button for input and a RGB LED as feedback, which responds to button presses and asynchronous events from the network. As the ...
4
votes
0answers
77 views

How to abstract from a display?

I'm building an embedded text editor consisting of a keyboard, an LCD display and a PIC32 microcontroller, to be programmed in C. The application should look, for example, like the GNU nano editor. ...
2
votes
2answers
503 views

MVC with Post/Redirect/Get

I have a question in mind for the MVC pattern for a long time now. When using the Post/Redirect/Get principle then it doesn't make sense to use ONE model in the sense of MVC, right? Why should I ...
0
votes
2answers
334 views

Where and how to reference composite MVP components?

I am learning about the MVP (Model-View-Presenter) Passive View flavour of MVC. I intend to expose events from view interfaces rather than using the observer pattern to remove explicit coupling with ...
2
votes
1answer
424 views

Usage of MVVM in iOS

I'm an iOS developer and I'm guilty of having Massive View Controllers in my projects so I've been searching for a better way to structure my projects and came across the MVVM (Model-View-ViewModel) ...
6
votes
3answers
150 views

Where in an MVC web application should writing files locally go?

In my web application that uses an MVC framework which has different modules for models, views and controllers I talk to several databases and APIs. Those are implemented as individual models. A lot ...
2
votes
1answer
312 views

How to efficiently handle related data in MVC?

Talking about MVC with servlets and JSP's, in a context about products and manufacturers , when querying the application for a list of products: the servlet loads a list of products from the ...
16
votes
6answers
3k views

Where should I put an API request in MVC?

I'm building a web application using a MVC pattern. Following this kind of architecture we can see that all the methods used to interact with database are implemented in the model. But what happen if ...
0
votes
1answer
22 views

VO to Entity Conversion

In our application we have multiple layers. UI -> This can be JSP/ JSON result of the API Controllers -> as in MVC Services -> perform single business operation per service DAOs -> Data Access ...
11
votes
3answers
823 views

Massive View Controller - IOS - Solutions

I'm sure every new iOS developer has the following problem: The View Controllers get very fast crowded with code for various purposes, easily getting to 500 + lines of code. This is how it looks like ...
0
votes
1answer
49 views

PHP MVC concept large controller

I have custom MVC framework in PHP and my controller file has about 5000 lines. The question is, is it a big concept flaw? It is structured code with kiss method and quite maintainable. Are there ...
2
votes
1answer
5k views

Java desktop application using MVC + Hibernate

I'm developing a Java desktop application. I'm planning to use MVC architecture described at Oracle site: Java SE Application Design With MVC. I need to store data in database so I decide to use ...
1
vote
1answer
47 views

Where to put the domain in MVCS

From what I've read and understand MVCS (Model-View-Controller-Store) is a design pattern that lets you do the following: View - Application view, what the user will see. Controllers - Manages the ...
10
votes
5answers
5k views

In MVC, what is the difference between controller and router?

Do they mean the same thing (attaching URLs to actions, or actions to URLs) or is there any difference I'm missing? Example: http://github.com/dannyvankooten/PHP-Router vs. http://konstrukt.dk
-1
votes
2answers
113 views

MVC is a kind of Design Pattern? [duplicate]

While I was trying to concrete the concept of design pattern, I came up with a question: As I asked in the title, Is MVC(Model-View-Controller) architecture kind of Design Pattern?
1
vote
2answers
415 views

Is it wrong to have HTML strings within PHP objects, or is it only wrong in controllers?

I've always thought that in typical MVC design it is bad practice to build & concatenate HTML strings in any PHP file or class that isn't strictly a template. I'm working on a large project with ...
0
votes
0answers
104 views

Any “Gotchas” to using Entity Framework for Identity & Dapper for all other DB access in a .NET MVC application?

I'm firing up an MVC project in which I'd really like to use Dapper as my ORM, as I like to be as close to the database as possible for performance and SQL tweaking reasons, yet still have the power ...
3
votes
1answer
727 views

MVC content management framework with an admin panel

I've lately been developing my own MVC content management system using PHP and, at least in my mind, am a little stuck with the system design. I believe this would apply to building a content ...
0
votes
0answers
60 views

Server-Side MVCs vs Client Side MVCs

Recently I was asked to do a project as a technical assessment. The assignment is to create a website using Twitters API. The assessment recommended using Django. When I quickly looked up Django I ...
0
votes
0answers
40 views

Event-handling in WinForms MVC-Implementation

I am trying to implement sort of an MVC-Pattern (Passive View) for a winforms-application to clean up the code. The basics are quite clear and I did implement some views of the application in ...
1
vote
2answers
55 views

How many views and controllers do I need?

I did one AngularJs app which was rather complex, with multiple nested tabs, which had multiple nested views & controllers, needed ng-router, and was quite tricky for me to implement, as browser ...
1
vote
1answer
206 views

MVC Widget optimization when accessing CSS and Resources

So we're trying to re-imagine our web solution in an MVC fashion. Going from an old webforms based solution to working with ASP.NET MVC with a bootstrap main menu and adding functionality in the forms ...
2
votes
1answer
61 views

Getting items from a ListView - without breaking MVC paradigm?

I've got an arraylist of SpecialParts. A SpecialPart is an object that holds a bunch of information about itself: name, ID, date created, etc. I've got a ListView that presents the user with all the ...
3
votes
1answer
235 views

How to pass control between sub-controller to parent controller in Java MVC Design Pattern?

I'm pretty new in Java, but I've done plenty of research and I know what MVC is. However, to implement MVC in Java was a difficult task. I followed this tutorial, which helped me to realise that the ...
227
votes
13answers
35k views

Should you write your back-end as an API?

I had a heated discussion today about our MVC application. We have a website written in MVC (ASP.NET), and it usually follows the pattern of do something in the view -> hit the controller -> ...
0
votes
1answer
335 views

How to update User interface form through database update

I have a client server application. Assume I work as a Support executive, resolving customer tickets. We(our support team) have got two tickets to work on. Ticket 1: Client "Liver" raised a ticket ...
3
votes
1answer
188 views

Model of simple traffic simulation [closed]

I want to write a simple traffic simulation with one road intersection. First I thought of a cellular automata in the model but it should not be limited by an underlying discrete grid system so the ...
2
votes
1answer
110 views

Doing the same thing from different views

I have an MVC app, which has multiple views that give overviews (from different angles) on items. For now, let's just call these views View1 View2 ... ViewX They all use the same Model Collection ...
1
vote
2answers
160 views

PHP MVC how to access current user?

What is the best way to tell if a user is already logged in when accessing the page? I have seen many people talk about a Recognition service that will validate a user trying to login, but what about ...
8
votes
6answers
396 views

How to determine what should get its own respective controller?

I'm using the MVC pattern in my web application built with PHP. I'm always struggling to determine whether I need a new dedicated controller for a set of actions or if I should place them inside an ...
0
votes
0answers
99 views

MVC architecture with JavaFX

I am working on a rather small Java application for a university project. We are forced to use a pretty strange interpretation of the MVC pattern which says that we should only have one generic ...
6
votes
2answers
270 views

Is it necessary anymore to extract logic from API controllers?

I've been working in MVC web frameworks since its they started getting popular with RoR and ASP.NET MVC. I have always been careful to never put "business logic" on my controllers since that couples ...
1
vote
0answers
92 views

How do I handle authentication in an ASP.NET webapp with offline-capable client code?

I hesitated before writing this question, as it sounds like I'm after an opinion without trying anything yet. That's not the case, I just don't want to go down the wrong route with architecture - it ...
1
vote
0answers
103 views

MVC question for a console application with multiple controllers?

My question concerns an administrator's console application. The requirements around it are that administrators should be able to log in (other types of user cannot), and they should then be able to ...
9
votes
2answers
8k views

How to completely decouple Model from View/Controller in Java Swing

Is there a collection of commonly-agreed-upon design guidelines for separating the Model classes from the View/Controller classes in a Java Swing app? I'm not so concerned that the View/Controller ...
3
votes
1answer
160 views

Partial Model Updates From View

I hope this is on-topic here since I'm a bit new to the whiteboard... I'm currently developing an application using ASP.NET MVC 5 (and WebAPI 2). One of my domain entities is huge, and is stored in ...
1
vote
1answer
40 views

Share service instances amongst all controllers?

We've taken over coding on a .NET MVC project, and as I'm relatively inexperienced with many of the MVC design approaches, I'm working on getting a good understanding of the design choices. One ...
1
vote
1answer
380 views

MVC: How to Implement Linked Views?

I'm developing a java application to visualize time series. I need (at least) three linked views, meaning that interaction with one of them updates the others. The views are: A list represents the ...
2
votes
1answer
92 views

Encapsulating business logic that goes beyond validations in MVC

I'm pretty clear business logic goes into Models. But on this question, they refer to business logic as pretty much low level validation (if the user signs up, ask for their e-mail). What about ...
2
votes
0answers
44 views

Updating an entity via a service layer

What's the best way to update an entity using a service layer? Performing a single, atomic action I can understand like BlogService.Publish(blogID) but what about editing multiple values which map to ...