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

learn more… | top users | synonyms

1
vote
1answer
3k 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
143 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
141 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
753 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 ...
22
votes
2answers
16k 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
509 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
289 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
785 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
1k 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 ...
2
votes
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
5k 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
403 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
370 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
215 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
199 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 ...
5
votes
3answers
724 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
165 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
468 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
749 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
613 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
267 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
111 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 ...
1
vote
1answer
557 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
999 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
145 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
865 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
120 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
134 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 ...
2
votes
2answers
5k 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
253 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 ...
2
votes
1answer
289 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
211 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
183 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
521 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{ ...
8
votes
4answers
933 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
92 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
71 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
1k 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
402 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
550 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
229 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
77 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 ...
1
vote
2answers
591 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
132 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
481 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 ...