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

learn more… | top users | synonyms

2
votes
5answers
6k 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
0answers
55 views

URL and Controller structure for parent-child-relationship

I use an MVC web framework to create an application which contains a hierarchy: Location <1-N> Devices <N-M> Services I have a number of Locations. Each Locations can have several ...
1
vote
0answers
104 views

Run a function when a function in a list is executed?

Goal: I'm currently doing an MVC project and I have this method to update the ViewBag (based on previous actions of the user). I would like to call this function whenever a certain list of MVC Actions ...
0
votes
0answers
94 views

How should I populate a list of database-sourced models?

I have a model which sources its data from a MySQL database using a load() public method. If I have a collection of models, I have to loop through each model and call its load() method individually; ...
0
votes
0answers
55 views

Specific class to pass a bundle of data from my Model to Controller or a simple Collection?

I am doing an Invoice application implementing MVC pattern design in Java. One of the features my application has to have is showing all info about a Customer: Personal data, Calls, Invoices, ...
2
votes
2answers
258 views

MVC: “User” model gets big and crowded. Should methods that do CRUD operations on one-to-many relationship data be in different models?

In most MVC web projects there is a User class. Many times a user has something else in a one-to-many relationship, i.e. orders. If we have a user class that has many orders, should methods that add, ...
3
votes
2answers
185 views

Which do you code first, MVC? [closed]

I have been coding for a good bit, and I found a project I want to work on -- a python web app using django + mongodb. I know what I want my web app to do. When you are in this circumstance (just ...
0
votes
1answer
122 views

Design MVC site such that UI developer can work without access to data tier? [closed]

I'm working on an ASP.NET MVC site (using Team Foundation Service for source control) that I've divided into a few separate projects under one solution: Project.WebAPI (Main entrypoint, contains ...
1
vote
1answer
198 views

Why no MVC methodology for desktop applications? [closed]

I'm currently learning how to develop web apps with C#, ASP, .NET and MVC. I am enjoying the MVC paradigm a lot, but then thought about using this to develop desktop software with. I googled around, ...
1
vote
2answers
266 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
1answer
176 views

MVC in a desktop application - can the View ever hold a reference to the Model?

(I'm specifying this is a desktop application so people wouldn't refer specifically to web implementations of MVC). The title says it all pretty much. In an MVC structure - can the View ever hold a ...
0
votes
3answers
130 views

Can MVC implementations differ in design-details and still be considered MVC implementations?

Is the Model-View-Controller pattern very strictly defined, to it's design details? Or is it a term, like many others, with lots of different interpretations and versions (that all fit the ...
4
votes
3answers
829 views

Model-View-Controller: Does the user interact with the View or with the Controller? [closed]

I have recently learned about the MVC design pattern. I'm learning from the Head First Design Pattern book. According to this book (if I understand correctly): The Model is most of the application ...
0
votes
1answer
178 views

Is it fine to skip MVC?

I am building a pair of components that communicates in a one-way fashion: [ JButton ] --> data...process...process...out --> [ JTextField ] The JButton allows the user to select a file and ...
0
votes
1answer
32 views

Pull Frequency Parameters in MVC architecture

Assume a simple SPA (Single-page application), maybe a dashboard and these basic conditions: The Model contains methods for accessing and displaying data; The View contains methods to load ...
-1
votes
1answer
201 views

Building a webservice with mvc [closed]

I'am planning my website over here based on MVC. And I am thinking about a webservice (who knows, maybe one day I'll create an android app or something). The site and the webservice will behave ...
35
votes
14answers
12k views

Isn't MVC anti OOP?

The main idea behind OOP is to unify data and behavior in a single entity - the object. In procedural programming there is data and separately algorithms modifying the data. In the ...
1
vote
1answer
128 views

Need help modelling a User/Project/Task relationship

So I'm creating a very simple project/task management application in Laravel 4 and I'm not sure how these relationships would work. I have a Project, Task and User model. A User can own a Project or ...
0
votes
5answers
2k views

What file extension do you use for your template/view files in PHP? [closed]

I'm building a Model-View-Controller framework, and it has come time to decide how I will be creating and using view templates and layouts. Some frameworks use special extensions for these files. ...
1
vote
8answers
507 views

Should PHP view files be called something other than '.php'?

By default, any file that PHP touches is usually suffixed with .php. It's universally understood by Apache / Nginx as the default for PHP files and most setups expect PHP files to end in this ...
0
votes
1answer
69 views

What is the best way to keep both html document structure and php control structure strongly visible in complex view file

I create a lot of views in my work as part of the common MVC pattern applied in web frameworks like Code Igniter and Cake. I also adhere to the following maxim as best I can: fat models and library ...
2
votes
1answer
1k views

Is there a best practice for populating a dropdown in ASP.Net MVC? [closed]

I'm coming into a project where the overlying method is to open the page, then use jquery AJAX calls to populate all of the dropdowns dynamically in the page. To me, this seems like an extra burden ...
0
votes
2answers
76 views

Why additional code and complexity when data model and interaction are simple is considered a disadvantage in MVC model

According to the slides given by my lecturer, one of the disadvantages of MVC model is additional code and complexity when data model and interaction are simple Why is this so, I would assume ...
1
vote
1answer
156 views

Web design pattern

I am building a small website, in PHP and I am using MVC design pattern for the UI. In the future I will need to add mobile support for my website. It will be in the sub domain "m" like everyone. All ...
2
votes
1answer
131 views

Models Views and Controllers jobs

First, I know there are lot of answers about MVC but I need some more-specific ansewer based on my probably wrong understanding of MVC. I've already read this very good answer (Explain Model View ...
2
votes
2answers
2k views

Domain Model vs View Model

I'm in the early stages of my programming career and I've been working with MVC for just about a year now. I've spent much time learning about the pattern and the concepts behind it, but as the ...
1
vote
3answers
281 views

MVC: What is the difference between a model and a service?

Why in some frameworks the logic layer is called "Model" whereas in some it is called "Service". Are they different from each other or just different by naming conventions? UPDATE 1 The reason I'm ...
4
votes
1answer
216 views

Designing storage service data structure for decoupled models sharing same data

Surely most of you remember the Norton Commander application where similar (sometimes the same) data is displayed in separate decoupled views. I'm building a web application that follows the same ...
4
votes
4answers
599 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 ...
3
votes
2answers
385 views

Help With Dependency Injection

I am still very confused as to why and when to use Dependency Injection. If anyone could explain maybe using the below example that would be great, any other explanations would be appreciated. Lets ...
-2
votes
1answer
160 views

Best practices in Application's flow diagram [closed]

I make web applications, mostly MVC, object oriented and database enabled. I always have trouble going back to project after a few months of release and work again. I don't even remember what I made ...
2
votes
2answers
126 views

Handling login errors with User Class

We have a User class which handles all things related to users within a Content Management System. As you'd expect, the class contains a function login(). This function accepts three arguments: ...
1
vote
2answers
272 views

Good Programming Practice for similar child classes

I am developing an iOS application, in which I have to draw some patterns on a view based on option selected by user. Let me explain you more clearly. User will be shown number of images as options ...
2
votes
3answers
205 views

How to properly distinguish between MVC and three-tier?

Many webapp frameworks, e.g. Spring,call themselves MVC frameworks, but how is the distinction done between MVC and three-tier? It seems that some frameworks call themselves MVC frameworks but they ...
0
votes
1answer
143 views

Separating entities in the business logic layer

I am going to start a project, which in the BLL would have something like: Jumper Map Record I need to keep track of all those, so I will make probably classes which hold them, e.g.: JumperList ...
0
votes
1answer
223 views

Practical Use of Depency Injection (IoC) Container

I am creating a MVC-ish framework in PHP. I am trying to implement a DI Container to allow the creation of controller objects (among others). My MVC framework is pretty typical. Each module (or ...
3
votes
1answer
1k views

Opensource showcase for MVC in Java Swing [closed]

I've allready created small desktop CRUD applications using Java/Swing. In hindsight I'm not quite sure if the overall design of these applications is good. I've also done some reading on MVC and ...
3
votes
1answer
137 views

When is it okay to reassign the model for a view in MVC?

Is it ever really acceptable to reassign the model for a view in MVC? (Or MV* where applicable.) In other words, for a single view instance, is it ever ok to reassign the view's model? That is, as ...
2
votes
2answers
200 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 ...
17
votes
10answers
4k views

Best practice or design patterns for retrieval of data for reporting and dashboards in a domain-rich application

First, I want to say this seems to be a neglected question/area, so if this question needs improvement, help me make this a great question that can benefit others! I'm looking for advice and help from ...
61
votes
13answers
6k views

Why is it a good idea for “lower” application layers not to be aware of “higher” ones?

In a typical (well-designed) MVC web app, the database is not aware of the model code, the model code is not aware of the controller code, and the controller code is not aware of the view code. (I ...
2
votes
2answers
503 views

Package diagram for an MVC patterned project?

We are required to make a package diagram for our senior project. Since our project uses MVC patter design, we created an MVC class diagram, now, our problem is in creating the package diagrams from ...
2
votes
4answers
1k views

To MVC or not MVC, that is the question

Originally, I started off doing jQuery plugins, then moved onto Backbone.js applications, then been experimenting with MicroJS MVC modules, but these days I'm even wondering if there is any need for ...
1
vote
0answers
51 views

Best practice or design patterns for retrieval of data for reporting and dashboards in a domain-rich application [duplicate]

First, I want to say this seems to be a neglected question/area, so if this question needs improvement, help me make this a great question that can benefit others! In my experience, there are two ...
-1
votes
2answers
150 views

How to fit requirements into MVC

Let's say we have a website requirement to allow User functionality. Simple! We create the UserModel, UserController and UserView. Works perfectly. However, let's assume that User has a many-to-one ...
1
vote
1answer
274 views

Creating a System Sequence Diagram from an [extended] use case

As I have been taught - one controller = one use case. But I have: OutsiderController SupplierController (which extends OutsiderController) SubContractorController (which also extentds ...
18
votes
4answers
13k views

How to avoid big and clumsy UITableViewController on iOS?

I have a problem when implementing the MVC-pattern on iOS. I have searched the Internet but seems not to find any nice solution to this problem. Many UITableViewController implementations seems to ...
2
votes
1answer
95 views

Which layer should order the columns shown to the user when using MVC?

Say you want to render a table with five columns, but you want the order of the columns to be different depending on some specific parameter. This would be very easy to accomplish if the model sets ...
0
votes
1answer
270 views

How would I structure my code into an MVC format?

I want to have the home page (root of the website), check if a cookie exists for a user being logged in, and then based off of that determining whether or not to load the sign up page (landing page) ...
0
votes
1answer
91 views

Terminalogy “Controller” in MVC and “ViewController” in IOS

While studying IOS, i generally come across viewcontroller. That gives me, confusion, if this "ViewController" has to do something with controller ( in MVC ) ? But how come both "view" and ...