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

learn more… | top users | synonyms

0
votes
1answer
26 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 ...
185
votes
12answers
27k 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
0answers
30 views

Design for iOS UI, Views/Containers [closed]

I'm trying to create an iOS application that receives a graphics configuration from a database. A server will send the XML to the application and the application will render whatever the XML contains ...
-1
votes
0answers
25 views

Single page displaying 2 different models (MVC Pattern) [on hold]

i want a single page to display 2 different Entities/Models using MVC pattern.When i load the values from database it works just fine.But the problem is when i add a new value at that time to either ...
0
votes
0answers
41 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 ...
1
vote
0answers
52 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
71 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 ...
1
vote
1answer
28 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 ...
2
votes
0answers
29 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 ...
2
votes
1answer
83 views

Advice on architecture (WCF / MVC)

First of all, the basics. N-tier application: presentation, business layer, database. It is an old .NET 2.0 (WSE + WinForms) application, a bit more tightly coupled than I'd like, and the requirement ...
1
vote
2answers
136 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 ...
1
vote
0answers
64 views

Top Menu bar driving a sidebar sub menu

I have an application written is C# ASP.NET MVC 4 with Razor views. I am a bit stuck on my menu structure. As per the image above, one can see that there is a Top Menu and a Side Menu. The ...
0
votes
2answers
90 views

When developing an MVC framework, how should I be using Knockout.js?

I'm currently using the Laravel PHP MVC Framework to develop a web application; and it's going along quite nicely. I'm very comfortable with the expectations of the framework and how my application ...
1
vote
1answer
66 views

role based access control model in object oriented

I want to prepare a swing application. I am designing a role based access control model in mvc design. When a view wants to request something from a controller, how can this request be realized in ...
0
votes
0answers
31 views

Will this singleton style class work with accessing a session on multiple MVC controllers?

Question background: I have an e-commerce site I'm developing that requires multiple controller methods to access a single session variable. The idea: My idea was to create a singleton style class ...
0
votes
1answer
64 views

How to represent a Model with a 1:N relation?

I have a task to associate 1:N documents to a record in my hardware table. This file could be a warranty, or whatever. In SQLServer I set up a FileStream group and made a table for only the file and ...
1
vote
1answer
84 views

How bad is it that my index.php in a Zend Framework MVC application mixes definitions and side effects?

I'm introducing some more coding quality standards and checks via a new project - in particular, the PHP-FIG recommendations. This project using Zend Framework 2, and I have a fairly simple entry ...
1
vote
1answer
85 views

MVC, pagination, and massive search criteria

I am currently working on a project that has a fairly large search form - the form is 30 or fields or more. Now I can of course map this out for routing by having my application pull the parameters ...
6
votes
2answers
253 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 ...
2
votes
1answer
107 views

In MVC, who is in charge of handling observers?

(I'm writing a large MATLAB GUI that makes significant use of MVC, so my example is written in MATLAB. However, I believe this question is language-agnostic. Please correct me if I'm wrong.) I have a ...
1
vote
2answers
189 views

Is MVC controller an use case controller?

In GRASP (http://en.wikipedia.org/wiki/GRASP_(object-oriented_design) ), a controller (use case controller) is defined as: A use case controller should be used to deal with all system events of ...
0
votes
1answer
30 views

How can I approach application programming from a database background? [closed]

I have a lot of database experience, but virtually no application programming experience. At work, we have an EDMX? model generated from entities in the database, and we transform T4 templates to ...
1
vote
5answers
156 views

MVC - Checking data in the model or the controller?

I'm currently creating a web application with Ruby on Rails and I'm facing an conceptual problem about the MVC pattern. If I need to check, for example, if the name of a data that I want to add in ...
5
votes
1answer
385 views

Where we should not use MVC? [duplicate]

I have a software engineering course project that we should design a web application, so I've decided to read about software architecture patterns. I've read a lot about what is MVC and its ...
3
votes
1answer
102 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
126 views

What OpenID Connect flow is right for me?

Here's the deal. I have a .NET MVC5 web application that I'm moving up to the OpenID Connect standard. I also would like to be able to access controller methods from a mobile app (much like an API) ...
1
vote
2answers
55 views

How to maintain atomicity with a service like pattern

Imagine a route in an MVC web project which handles editing a user of your product. You can do things like change their name, their email, their group, their roles and so forth. This data is put in a ...
0
votes
0answers
112 views

Using xsd2Code and custom c# classes

I am using the xsd2code class generator to generate classes based on a schema file provided by a system vendor. This vendor also provides a REST API to access data via Web Services, and I've had a ...
1
vote
0answers
57 views

Where should business logic involving SQL go? [duplicate]

I have this question that's been bugging me all day. I have a function like this: public void voidUsersByUserId(List<Integer> userIds) { Query query = ...
1
vote
1answer
106 views

Clarification on MVC Architecture Overview

I'm doing an MVC 4 architecture diagram for a report and since I'm relatively new to MVC,i was wondering could some one clarify with me is REST (HTTPPOST etc) between view and controller, or ...
0
votes
1answer
107 views

Architecture for web and mobile clients

The application that I work on needs to have a web interface (ASP.NET MVC) and mobile interfaces (Android/IPhone native). The features for mobile applications and web application might not overlap ...
0
votes
1answer
118 views

MVC: Creare sub folders under View

I am working on a small ERP Application and using MVC5 for it. I have several Modules in the application and each module contain several web pages (Views, you can say). i.e: for School application I ...
2
votes
2answers
94 views

Is it OK for an MVC view to request data from other sources than just the model?

I'm working in ASP.NET MVC, but this question is pretty much applicable to any MVC framework (and maybe even others). In a typical MVC application a request arrives at the controller, which then ...
2
votes
1answer
205 views

How do you separate view from logic in a Winform application?

I know there are patterns like MVC to separate view from logic, however, I don't know how common they are in Winform applications. For a C# Winform application, I may start with a Form and gradually ...
-1
votes
1answer
95 views

Put Business Logic and Model Declaration in Different DLL [closed]

I am new to MVC and started working on a small application. I have a basic idea about what to do and want to use MVC and EntityFramework. I want to create a separate Business Layer. I want to put ...
0
votes
0answers
30 views

Question on web MVC and views for a single page app

I'm trying to wrap my head around on which would make a better approach. Let's say my page has a combo box and a list box with a button. ---------v Combo --------- list --------- --------- ...
2
votes
3answers
449 views

When do programmers use code first approach?

This is just not related to asp.net mvc but rather related all the mvc frameworks that support code first approach. One of the advantages I often see on asp.net mvc and tutorial blogs is that it ...
2
votes
2answers
397 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
1answer
101 views

Where to put utility classes in php mvc?

I'm working on my first MVC website, where can I put utility classes like Security and Date (my native date) classes, are they model too? App | |--- Model |--- Controller |--- View
2
votes
1answer
79 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 ...
1
vote
1answer
76 views

PHP MVC Model with a method to fetch all of the model from database

I have a crazy question, consider I'm developing a blog website, There is two model named Post and Comment, now I wanna add a method to fetch all comments from database, which model should I choose to ...
1
vote
2answers
290 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 ...
0
votes
1answer
111 views

Where is asp mvc model data stored?

I am using ViewModel classes in order to structure data being populated inside of a controller. My questions is now where exactly is data of a @model stored after being populated via asp mvc ...
1
vote
1answer
47 views

Proper MVC practice for a hierarchy of elements

I am trying to develop my first major MVC application, and as such I am new to doing this on a large scale. I've read as much as I can online and am continuously striving for making my code as clean ...
1
vote
0answers
52 views

what is the best method to return db query and additional information from other methods

I am new to MVC and trying to continue to learn base on best practices. I am trying to return data from multiple sources -- one source being a mysql db query and another source from another method ...
0
votes
1answer
76 views

Architecture: 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, ...
1
vote
4answers
83 views

When to use controllers in mvc

I am studying mvc5 in asp.net and wondering if there is a general rule when to use a controller. If I have a business object like Employee will I create a controller named Employeecontroller? But why ...
1
vote
3answers
167 views

Controller in MVC

Alright so it is an essential part of OOP that one class should only do one thing, and it makes sense. In practice I've seen that classes which don't obey this rule get thick and cluttered. So I was ...
4
votes
3answers
196 views

MVC: How dumb should the view be?

creating an MVC structure and pondering this... My view has an Add button. Click it and we send off a request to the controller (using pub/sub so view doesn't really know who its talking to). Having ...
3
votes
2answers
162 views

Why is the Document Object Model the view?

I was told by a Javascript programmer not to do DOM manipulation in model code. I also remember hearing a snazzy tune for a JS framework (I forget which one): "Get your models out of the DOM". This ...