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

learn more… | top users | synonyms

1
vote
4answers
565 views

MVC to create desktop and mobile webapps? [closed]

I'm planning the creation of a webapp with a dedicated mobile web interface and a dedicated desktop/tablet interface. I am considering ASP.NET MVC, but it is clear to me that MVC is for separation of ...
2
votes
2answers
166 views

HMVC and Database Connections

Whilst I have good experience with OOP, I'm fairly new to the concept of (H)MVC. I understand the basic concept of modular design that comes with HMVC, it's the great attraction of it. But one thing ...
2
votes
2answers
86 views

We have a custom program that generates all the stored procs and classes for the Data Tier. Where will I put the generated classes?

This is more of an architectural question regarding MVC and Data Access: We have a custom program that generates all the stored procs and classes for the Data Tier from the MS SQL database. It's ...
1
vote
2answers
231 views

Is there a design pattern that describes the separation of a Form from a Model

I am working on a web application implemented in C#, that follows MVC conventions. This application contains a page that allows me to create or update a Wingding. The view passes a complete Wingding ...
0
votes
1answer
142 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 ...
0
votes
1answer
30 views

how do you style content when querying a data structure nested n-levels deep?

This question has come up while writing a simple text adventure game where your character has an inventory, which can include containers that also have things in them. I want a clean way to style the ...
0
votes
2answers
221 views

What could be the Model Layer when consuming Web-Services and no Database in Django?

I'm using Django as an application framework and it only needs to consume web services (no need to have traditional Django Models and the related ORM). In this case, since Django is a variant on the ...
2
votes
0answers
236 views

Is this any form of service pattern, some other pattern, SOA or just an anti-pattern?

I'm going to set out a scenario/pattern I've encountered and then I have a few questions pertaining to it. During an MVC request in a web framework (PHP, Laravel in my case), if I have an abstract ...
0
votes
2answers
120 views

MVC sending information from view to controller

I am using the MVC pattern. Lets say I want to create a new object and add it to my database. Where is it better to create the new object: View: Boo boo = new Boo("awesomness"); ...
2
votes
3answers
2k views

REST API at backend and MVC Javascript framework at client side

I am building an online social network. I have finished writing RESTful API service using Django. This will return only JSON response (No HTML will be generated from server side) so that this JSON ...
0
votes
3answers
2k views

MVC Design Pattern to Combine Multiple Models for use

In my design, I have multiple models and each model has a controller. I need to use all the models to process some operation. Most examples I see are pretty simple with 1 view, 1 controller, and 1 ...
0
votes
1answer
1k views

Making Class Diagram for MVC Pattern Project

I have a question about making a class diagram for an MVC based college senior project. If we have 2 actors of users in my system, lets say Undergrad and Graduate students are the children of ...
1
vote
3answers
394 views

MVC is a GUI Architecture or a Architecture to GUI and Domain?

Fowler refers to the MVC, as a GUI architecture: There have been many different ways to organize the code for a rich client system. Here I discuss a selection of those that I feel have been the ...
2
votes
5answers
4k views

Business Logic Layer in MVC Application

In my ASP MVC application I decided to add another Business Layer and made the model only to have properties. All other functionality like save to db, get from db is done on this new Business layer. ...
0
votes
3answers
253 views

What are the steps to grouping related classes into packages

What are the steps needed to be taken to group related classes into packages in Java? In my case, I have about a number of .java files that I'd like to group into 3 packages according to the MVC ...
0
votes
1answer
214 views

Implementing separation of concerns via MVC

I'm creating a question to see if my understanding of MVC separation is correct, I haven't been able to find a clear answer anywhere online. So is this the right way to implement it (in Java): I ...
4
votes
3answers
227 views

Tell a user whether they have already viewed an item in a list. How?

It is pretty common for a web application to display a list of items and for each item in the list to indicate to the current user whether they have already viewed the associated item. An approach ...
1
vote
3answers
164 views

Law of Demeter in MVC regarding Controller-View communication

The scenario: Having a Controller that controls a view composed of complex subviews. Each one of those subviews is a separated class in a separate file. For example, one of those subviews is called ...
2
votes
1answer
415 views

Is it bad practice to call a controller action from a view that was rendered by another controller?

Let's say I have an OrderController which handles orders. The user adds products to it through the view, and then the final price gets calculated through an AJAX call to a controller action. The ...
13
votes
4answers
653 views

Switch vs Polymorphism when dealing with model and view

I can't figure out a better solution to my problem. I have a view controller that presents a list of elements. Those elements are models that can be an instance of B, C, D, etc and inherit from A. So ...
4
votes
2answers
284 views

Permissions and MVC

I’m in the progress of developing a web application. This web application is mostly a CRUD interface, although some users are only allowed to perform some actions and see only some parts of views. ...
4
votes
4answers
457 views

Business rule to display data in all uppercase - how to handle?

Part of a system I am working on manages some securities information (stocks, bonds, etc...) and business rules specify certain fields be displayed only in all CAPS (stock symbols and CUSIPs for ...
4
votes
2answers
1k views

Best Practices PHP mvc routing

I have a custom MVC framework that is in a constant state of evolution. There's a long standing debate with a co-worker how the routing should work. Considering the following directory structure: ...
7
votes
2answers
4k views

.NET MVC project architecture / layering

When planning the architecture for a mid-large scale MVC web application how do you implement the layers to be as decoupled as possible and easy to test? (basically follow best practices) Let's say ...
4
votes
2answers
647 views

Managing threads in Java with a good pattern

This morning I began writing a minimal chat using Java socket and threads but it took some minutes for me to experience a lot of problems in the MVC management. Currently I have 3 classes: Main, ...
1
vote
1answer
2k 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
2answers
2k views

Use a service layer with MVC

If a controller gets to fat and model instantation starts to add up a service layer could be used. If I just wrap the logic inside a service class I will get a bunch of Services with one/two ...
1
vote
2answers
140 views

MVC Models instantiation

Where should the Models be instatiated in a MVC arhitecture? I understand the preferred way would be outside controllers, in a bootstrap file and injected using a Dependecy Injection Container. But ...
1
vote
1answer
130 views

how to model a connection to a resource, with rudimentary event processing

For my simple MUD client I'm using Apache Telnet (no, not ssh). A mud client is a strange beast: Generally, a MUD client is a very basic telnet client that lacks VT100 terminal emulation and the ...
4
votes
2answers
737 views

How does MVC work with the principle “Tell, Don't ask”?

Procedural code gets information then makes decisions. Object-oriented code tells objects to do things. — Alec Sharp So, when a view wants to display some information that is suppose to be ...
21
votes
2answers
14k views

Mixing Angular and ASP.NET MVC/Web api?

I come from using ASP.NET MVC/Web API and now I am starting to use Angular but I am not clear on the proper way to mix them. Once I am using Angular does the MVC sever side concepts still provide any ...
1
vote
2answers
482 views

What about using MVC as the way to provide Responsive Web Design?

Responsive Web Design shows the user different elements -- or elements arranged in different ways -- by using media queries (if the device is a desktop or laptop, show them this; if a tablet, show ...
2
votes
2answers
275 views

Is state pattern a good solution for implementing UI changes for Landscape and Portrait modes?

For our iOS app, a lot of complicated UI logic depends on the interface orientation of the ViewController. This conditional logic is present in a lot of places. Can it be segregated into different ...
6
votes
4answers
723 views

Clean, Modular Code vs MV* Frameworks [closed]

I've been hearing a-lot about the "new" MV* frameworks. I've tinkered with KnockoutJS, creating an invoicing application, but I much prefer to write clean, modular code in raw JavaScript - leveraging ...
2
votes
3answers
982 views

Good practice for object instantiation in MVC

In MVC the Domain Models(from Model Layer) should instantiate other Domain Models or all the Domain Models should be instantiate in the controllers and passed down using Dependency Injections? How do ...
25
votes
8answers
5k views

MVC Architecture — How many Controllers do I need?

I have been coding for a while, but mostly scripts and simple applications. I've moved into a new role where it is all about developing Web Apps and using a proper MVC architecture, so I am ...
1
vote
1answer
1k views

Do MVC web frameworks favor anemic domain model in order to avoid duplication?

Binding directly the form to your model helps a lot to get rid of boiler plate code, but that means that your model must have a getter/setter for each property otherwise it wouldn't be possible. ...
34
votes
5answers
4k views

What are the downfalls of MVC? [closed]

I've been using MVC/MV* since I started actually organizing my code years ago. I've been using it so long that I can't even think of any other way to structure my code and every job I've had after ...
4
votes
1answer
397 views

Should I use JavaFx properties? [closed]

I'm usually very careful to keep my Model, View, and Controller code separate. The thing is JavaFx properties are so convenient to bind them all together. The issue is that it makes my entire code ...
1
vote
4answers
364 views

Is it fair to call a database or a document a “Model”, as in Model/View/Controller?

Part of my job is working on line-of-business applications built around client-side databases, such as Access or FoxPro. Other times these local LOBA's have direct document access, such as an exact ...
0
votes
1answer
205 views

Zend Framework 2 - Keeping all the models and mappers in Application module?

I am in process of planning web application by following the best practices and approaches of software development. I am building this application using zend framework 2 and going through its ...
4
votes
2answers
190 views

Breaking Up A Model Class - MVC

I am not sure whether there is a 'right' or 'wrong' answer to this one, but I was curious about the general consensus. I have a User model that currently performs user functions (such as retrieving ...
4
votes
3answers
703 views

What is a good strategy for binding view objects to model objects in C++?

Imagine I have a rich data model that is represented by a hierarchy of objects. I also have a view hierarchy with views that can extract required data from model objects and display the data (and ...
1
vote
2answers
157 views

Does a group of Select Statements count as a valid model?

I'm making a facebook app and I'm trying to follow MVC properly. But I was wondering if I had a class that was a bunch of fql queries (getting data from facebook) should I have keep these in a ...
-1
votes
3answers
446 views

Host an MVC 3 with Razor syntax app on old server

I just started a new job, I have to create a web app for them and host it on their intranet on an Windows 2003 R2 server with SQL server 2008. As said in the question, I'll work on a MCV3 with Razor ...
3
votes
2answers
645 views

application logic, business logic, models, controllers - where to put the application's brains?

I'm trying to wrap my head around models, views, and controllers, but I feel as though the more I read, the more conflicting information I seem to encounter. I guess the general goal is--as far as ...
1
vote
3answers
590 views

Model-View-Controller: who caches the data?

I am building a GUI to interface an embedded device to a PC host. The GUI provides control over the device parameters and displays some feedback from it. The GUI also has to emulate some of the device ...
2
votes
2answers
254 views

In MVC software, who should load the models?

I'm working in a REST JavaScript client, and I'm trying to follow the MVC pattern, but a very basic question came to my mind: who should make the http request and load the data into the model? My ...
0
votes
0answers
103 views

Are 3rd-party controls and MVC anathema?

At http://www.codeproject.com/Articles/552846/Why-s-How-s-of-Asp-Net-MVC-Part-1, I read this: "You should not use Asp.Net MVC if you rely on 3rd party vendor controls for of the UI." The author ...
2
votes
1answer
2k views

Python GUI and MVC - get variable from other module

I am trying to split my code into different layers: GUI, reading the GUI, creating input, calculating the model, interpreting data, creating view, sending the view to the GUI. Somebody told me about ...