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

learn more… | top users | synonyms

2
votes
3answers
813 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 ...
23
votes
8answers
3k 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
924 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. ...
32
votes
5answers
3k 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 ...
5
votes
1answer
268 views

Should I use JavaFx properties?

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
354 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
194 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
181 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
669 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
141 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
377 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
526 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
544 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
211 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
85 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 ...
1
vote
1answer
1k 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 ...
1
vote
1answer
520 views

Trying to understand 3 layer programming [closed]

I am confused to understand the structure of a 3 layer programm. Where is good place for exceptions, entity and etc.? If I use MVC, in my UI model, how to transfer entity class to model class and ...
3
votes
3answers
677 views

Why should I adopt MVC? [duplicate]

I decided to get my hands wet and got the YII framework for PHP. I created my first application, then created new controller, model and view. Connected to database, got my record passed from ...
1
vote
1answer
132 views

Design pattern for complex view creation in sheet music

I've got a bunch of Note-Models with properties like pitchand duration. In music notation, these notes must now be placed into a certain bar on a certain line on a certain page, and so on. Many more ...
4
votes
3answers
508 views

Is it okay to call a model method in my view?

In the interest of keeping my Controller's skinny, I put a headline method in a Model. # My Model class Property def headline "#{name} | #{address}" end end (Then, Property Controller for ...
2
votes
1answer
113 views

Testing MVC models when using SQL referential constraints

I have an MVC web app that's wired against PostgreSQL. The DB uses the full gamut of various referential constraints to ensure referential integrity, as opposed to say the Rails approach, where you ...
-1
votes
2answers
127 views

Java generalization

I have a question regarding generalization. I know when it is needed to be done, but is it worth having an extra class for 1 field? e.g.: StatisticsCustomer has fields: Customer customer and int ...
1
vote
2answers
4k views

mvc pattern - splitting model into data-access and business logic layers

I've had a chance to try it out and I like it very much. I'm thinking of using it in all of my future projects. I'd like to hear some critique and opinions about it. I've done a little research on the ...
1
vote
1answer
241 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 ...
0
votes
0answers
256 views

Make a controller a superclass in MVC design pattern

I am really confused how to handle this. I have: model.Outsider model.SubContractor (which extends Outsider) Basically, Outsider would mean Supplier, but SubContractor is not a Supplier itself ...
2
votes
1answer
250 views

Do I need JUnit tests for the controller layer on a MVC when I have a database layer

I have a MVC which has this structure: ui controller db model Basically the controller doesn't really do much more than connection ui with db layer. Do I need to provide JUnit tests for the ...
3
votes
1answer
195 views

Architecture For Mockable DAL On Large Projects

I have recently been reading an article about creating a blog using ASP.NET and MVC, and in the article the user splits the Data Access Layer into a separate Class Library, and creates an interface ...
0
votes
1answer
172 views

Where should I put my method

I am writing a Java program using the MVC design pattern. I have classes Item and Supplier. In the database they are connected through a item_supplier table. I'm writing a method which will give me ...
1
vote
2answers
436 views

MVC pattern with JSF-Spring-MyBatis webapp

I've a Java webapp with these frameworks and I want to know if my implementation meets with MVC pattern: Controller Layer (V) I'm using JSF @ManagedBean public class Controller{ ...
6
votes
4answers
702 views

In MVC is it considered good practice to have private, non-action, functions in a controller class?

Sometimes action functions in the controller class can become huge and nasty, with many-many lines of code to simply control the flow of data from the Model to the View. At some point these huge ...
62
votes
13answers
5k 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
1answer
87 views

Java MVC extra classes

I have a simple MVC project. My current packages: gui controller db domain I want to put extra classes which I will use, e.g. md5 hashing, email validator (methods which I will use in more than ...
1
vote
1answer
68 views

how to map controllers , models, and views as a todo list

Before starting on a current project I was wondering if there is a terminology for what I am planning on doing? Basically what I want to do is map out every object in layers such as all the ...
1
vote
1answer
792 views

How to persist temporary data over multiple HTTP requests?

In our webapplication we have a list of questions that have to be answered by the user. These questions are served to the user one by one and will be saved once the last question has been answered. ...
1
vote
4answers
357 views

Is XML, HTML/CSS, XSL analogous to Model, View, Controller?

For some time in personal projects I have been using XSL to convert my raw XML data into human-friendly HTML/CSS (in simple projects, I have no JavaScript, so let's leave that out of the equation for ...
3
votes
2answers
437 views

MVC framework that uses classes instead of methods for actions

In most MVC frameworks, Controller class contains multiple methods, each representing one action. Then annotations and reflection is used to call those methods appropriately. But from OOP point of ...
2
votes
1answer
226 views

ViewController in programming

ViewController is a term for classes that handle views in a framework. This is especially used in MVC frameworks. I go through various projects, written by various programmers, who implement MVC in ...
2
votes
3answers
1k views

MVC View Question

In my PHP web page (index.php), I have a simple script that calls a "page" class, and then builds the page from it. Index.php executes methods within an instance of the 'page' class, such as ...
0
votes
1answer
73 views

Services in Model Layer

I understand services should have no state and no business logic. How can you implement a service like AuthentificationService considering these rules? All the methods in a service should be ...
2
votes
2answers
467 views

Search and Replace in MVC

What would be a good MVC/OOP/GRASP/SOLID structure for a search/replace functionality. Methods: search/searchNext/replace/replaceAll. I'm interested only in the PHP arhitecture and how a professional ...
3
votes
1answer
112 views

MVC URL formatting/design

In refactoring a lot of MVC code, I have run into an issue with my URL design. For example, let's say we have a Venue object public class Venue { public long ID { get; set; } public ...
5
votes
2answers
463 views

Javascript Architectural Model

Are there any obvious flaws to this OO architectural model which I intend to implement using javascript? It is similar to the MVP model but instead the role of the model is broken down into three ...
0
votes
1answer
121 views

Controller JSP - no view

Most people say do not use JSPs. But what if I have a JSP that does not show anything, it only acts as a controller? Why would I do that? Because we do not need to redeploy complete webapp to make a ...
1
vote
1answer
737 views

Which design pattern is typically used when designing a WCF data services driven Winforms application?

Please excuse me as I am a bit new to the following technologies and practices. I have been given the task to create a management suite utilizing an MDI GUI. This suite will be the front end to a WCF ...
2
votes
1answer
481 views

Is there a factory pattern to prevent multiple instances for same object (instance that is Equal) good design?

I have a number of objects storing state. There are essentially two types of fields. The ones that uniquely define what the object is (what node, what edge etc), and the others that store state ...
2
votes
2answers
616 views

MVC : Does Code to save data in cache or session belongs in controller?

I'm a bit confused if saving the information to session code below, belongs in the controller action as shown below or should it be part of my Model? I would add that I have other controller methods ...
3
votes
6answers
312 views

MVC shared model different required fields on different type

I have a model called Car and depending on what type of Car the user select the view is presented differently. For example the user selects from a grid of different cars and depending if it is a Volvo ...
0
votes
1answer
743 views

How to design an application that read files using MVC pattern?

I am going to write an application that reads data from a csv file, and display that data to the user. I intend to apply an MVC design pattern to create this application. A user will interact with ...
1
vote
1answer
330 views

Is this an MVC framework?

I have built a framework for my applications that has been working well, and I have always referred to it in my mind as an MVC. However, after reading some more on what an MVC is (not that I didn't to ...
0
votes
2answers
60 views

Is it 'safe' to expect myClasses to agree not to only call package Scope methods from other Package scope methods?

The questions says it all, but a quick overview of the situation. I'm creating a Model which contains classes (all inherriting myObject) which have a large amount of interconnection. I want the ...