MVC (Model-View-Controller) is a software architecture pattern that enforces separation of concerns.
0
votes
1answer
84 views
In MVC is it concidered 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 ...
37
votes
9answers
2k 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
39 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
37 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
137 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.
...
-3
votes
0answers
71 views
Is it Wise to disconnect the ui layer from the backend in mobile web apps? [closed]
What's the future when it comes to mobile web development?
I mean, traditionally, in the java world, we make use of Java EE technologies such as Spring, Hibernate and some MVC framework like Spring ...
1
vote
4answers
145 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 ...
2
votes
2answers
106 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 ...
0
votes
1answer
94 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 ...
1
vote
3answers
200 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 ...
-2
votes
0answers
65 views
Integrating PayPal with my MVC 4 application [closed]
I'm creating an MVC 4 browser based application that provides a service. The service will be free to start and then I'll start charging for it. I'd like to know, from people who have already done ...
0
votes
0answers
25 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
104 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
57 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 ...
2
votes
1answer
179 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
44 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 ...
0
votes
1answer
102 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 ...
-1
votes
0answers
164 views
Good source code project examples of MVC 4/Jquery I could use as a reference? [closed]
I have a few projects like Sportstore (from a MVC book) and MusicStore (from the MVC web site) I use as reference sometimes..
Is there any good site that combines MVC 4/Jquery or even just Jquery ...
1
vote
1answer
158 views
is a factory pattern to prevent multuple 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 uniquly define what the object is (what node, what edge etc), and the oens that store state ...
1
vote
2answers
123 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 ...
1
vote
1answer
36 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
0answers
9 views
MVC in Java console, GUI and Android apps [migrated]
I'm trying to make a class project in Java as a console app, GUI app and Android app. Project requierements say it has to be implemented using MVC, so if the teacher quits the View layer from i.e. ...
0
votes
1answer
144 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
223 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
54 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 ...
5
votes
5answers
502 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
215 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 ...
0
votes
0answers
59 views
How to ensure only one object for each item in my state exists?
I am refactoring an existing system heavily, merging some seperate programs and throwing in a proper MVC concept; working on the Model now.
My current system sits in the middle, one of a few views on ...
4
votes
6answers
240 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
158 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, ...
1
vote
2answers
149 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 ...
0
votes
1answer
140 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 ...
0
votes
0answers
81 views
something feels off about my model encapsulation
I have a model doing all the buisness logic. I use package scope methods to allow me to modify state on objects that the controller can view, but not change directly. Unfortunately, I'm actually ...
2
votes
2answers
188 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
464 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
119 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 ...
2
votes
1answer
146 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 ...
3
votes
1answer
104 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
168 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
167 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
121 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
296 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
369 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
316 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
227 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 ...
4
votes
2answers
341 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
...
2
votes
2answers
322 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 ...
5
votes
2answers
213 views
How to achieve N-Tier type in Codeigniter MVC
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
...
2
votes
2answers
261 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
242 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, ...




