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

learn more… | top users | synonyms

2
votes
1answer
302 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
214 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
185 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
552 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
985 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 ...
61
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
96 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
414 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
570 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
232 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
2k 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
78 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
636 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
138 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
490 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
135 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
891 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
506 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
673 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
452 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
894 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
358 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
63 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 ...
7
votes
4answers
3k views

Most MVC-strict php framework

I have been trying to wrap my head around MVC pattern for about 6 months.I've read tons of articles, Q&A, and blog posts about MVC and HMVC patterns, but I just simply don't get it 100%. I tried ...
3
votes
1answer
862 views

Is MVC the optimal pattern to build a RESTful web service?

Not being a Java practitioner, I recently came to learn about the JAX-RS specification and Apache CXF framework. While still wrapping my head around all these things, I also read the this question on ...
4
votes
6answers
401 views

Is MVC ever considered/applied system-wide?

I was having a discussion with a colleague and he bought up the topic of MVC and the use of ViewModels in ASP.NET MVC. The discussion was that, in an n-layer architecture, the UI, Business Layer and ...
3
votes
1answer
669 views

Should website frontends be rendered in client-side or server-side?

I've been talking to a colleague that comes from AS3 to the HTML world. He has created a small website (there are apparently no dynamic contents) following the no-flash rules for his very first time, ...
2
votes
2answers
390 views

Where's the separation between Presentation and Logic in Javascript MVC frameworks?

I had learned that following piece of code is bad because it is obstrusive javascript and mixes presentation with logic: <a href="" onclick="archive()">archive</a> The best practice was ...
1
vote
1answer
258 views

Service as a Model in MVC

I have a PHP MVC application and a file table. I need to implement the functionality: mark all as read. The best solution for the code I found so far was to put the actual implementation in a ...
2
votes
2answers
221 views

What should be in my model and what should be in my controler?

We are writing a system with a sort of quasi-MVC structure (it was never stated as that, but that's what it is). I'm building up a full knowledge of the system and the controller will have to make ...
0
votes
3answers
746 views

Models structure in PHP/MVC

I have some classes that are composed with ORM generated Models. example1: For example the Report.php (Model) is using a Document.php Model generated with ORM. Based on the document object a report ...
0
votes
2answers
276 views

Communication between View and Model

I have a basic issue with the MVC architecture. I am aware that the View usually listens to the Model. But how are user requests propagated to the Model? Currently I do it like this, when the user ...
3
votes
1answer
194 views

Ambiguous use of “Controller” in MVC

I have heard two separate uses for the term controller when speaking of the Model View Controller methodology. An intermediary section of code that communicates between the Model and View, tying ...
4
votes
1answer
916 views

The Service class in MVC

From time to time I find there is a need to build a service class. Something I can't really attach inside a model in order to respected GRASP and SOLID. So I created a class called ...
5
votes
1answer
300 views

Architectural questions regarding, MV** frameworks, NoSQL data models, and gradual refactoring

I have a web app I would like to gradually refactor by adding structure to it. I have narrowed down the options to Backbone (with some plugins), Ember.js and AngularJS My goal is to refactor that ...
5
votes
2answers
222 views

method to allow me ability to freely modify my classes, but make them immutable to others?

I am creating the model part of an MVC architecture. My one class will provide all the accesses to allow one to fetch system state. I want most of this state to be immutable as it shouldn't be ...
0
votes
2answers
194 views

What is a good technique to prevent unauthenticated users from accessing controller methods?

I have an event(s) controller: class Event extends CI_Controller{ public function index(){ } public function foo(){ } //Shouldn't be able to use this method unless logged in ...
6
votes
2answers
634 views

Why is using named routes for generating outbound URLs a violation of Separation of Concerns?

What is separation of concerns? In computer science, separation of concerns (SoC) is the process of breaking a computer program into distinct features that overlap in functionality as little ...
0
votes
1answer
1k views

ASP.NET MVC Web Site & WCF Web Service - Sharing functionalities

I have the following situation: I have to create a website and a web service that will share a part of the functionalities. This is why I do not want to write code twice. I have thought of the ...
0
votes
1answer
701 views

Problems for Sample Code [closed]

I was recently asked to write some sample code that solves a difficult technical problem. I've been mulling over what kinds of problems might be good to solve in code to demonstrate my skills in such ...
2
votes
2answers
811 views

How to use MVC in practice

I'm very confused. I can't even begin to understand how MVC would be implemented outside of web development. This might seem like too general a question, but how would one apply MVC. I have the ...
5
votes
2answers
1k views

Can REST API be used as business layer?

I am using PHP Codeigniter MVC design pattern and I had this project with some sort of specific business processes In my application I will be dealing with 2 existing REST APIs: Google Trello ...
4
votes
2answers
7k views

What is Delegation and why is it important in iOS programming?

At the moment I am teaching myself iOS programming, and one concept I find really hard to wrap my head around is delegation. What is it? Why and how is it used? What is the advantage? The technical ...
4
votes
1answer
738 views

How to achieve N-Tier type in Codeigniter MVC [closed]

I know that N-Tier intended to separate layers on different network but I would like to have the same code separation in codeigniter I got this idea to have Model : for database CRUD - > Data layer ...
3
votes
2answers
1k views

Codeigniter/MVC workflow

Bit of a workflow question. I'm just staring with MVC and wondered how other people usually work in MVC? The 2 options I see is to code the model and controller completely first and then work on the ...
7
votes
3answers
314 views

Is it safe to assume that one controller will only ever use one primary model?

So, I'm designing an MVC framework. In the name of keeping everything statically typed and non-magical, I've come to quite a problem with "automatically" passing models to a controller. So, ...
9
votes
3answers
2k views

Is the term 'Front-End' synonymous with 'Client-Side'? If so, is this always the case?

As a relatively new (self-taught) web developer, I've heard the terms front-end, client-side, back-end, and server-side quite often. To me, front-end and back-end were always synonymous with ...
2
votes
2answers
2k views

How to synchronize client and server model objects?

We have a client-server application with a thick client (GWT). There are client-side MVP presenters (MVC controllers) which hold references to some objects viewed in the GUI. Some user actions cause ...