MVC (Model-View-Controller) is a software architecture pattern that enforces separation of concerns.
1
vote
4answers
51 views
Advice: Switching to MVC from Webforms Web designer vs UI designer
Over the last two years, I've taken over a web application development group. My focus for the first two years was building teams, get technology updated and in-place, and fixing my customers pain ...
0
votes
1answer
48 views
Should models be returning data directly to the client, or to the controller instead?
Disclaimer: This is my first time: using node, creating a REST API, and trying out MVC server side. (so, just statistically speaking, I'm probably doing something wrong ¯\_(ツ)_/¯)
I'm working on ...
-1
votes
2answers
65 views
MVC as a subset of client-server architecture?
Can we say that MVC is subsystem (or subset, sub-architecture) of client-server architecture?
0
votes
1answer
42 views
What would be the best technique for website localization in MVC?
Currently I'm working on a big website that will be published on almost 40 domains with different languages. My question is what would be the best way of doing localization/internationalization. I'm ...
3
votes
2answers
189 views
Using MVC style, where is the best place to put SQL functionality?
I am wondering about best practices here.
MVC (Model - View - Controller) patterns involve separating components of your program that model the data, manipulate those models, and display those ...
1
vote
3answers
70 views
Should I keep “redirect only” methods in my Controller?
Controller:
function indexAction()
{
if ($condition)
$this->renumPosition($id); //LINE #1
}
//Redirect only - function's sole purpose is to call another function
function ...
-1
votes
1answer
22 views
Class that prepares strings from HTTP requests at PHP controller level
I have a library /Web/ such as follows
/Web/
Builder/
Builder.php
Exceptions/
ExceptionHandler.php
JSONSerializer/
CategoryJSONSerializer.php
...
1
vote
1answer
107 views
MVC Architecture: How to generate a view-model that is displayed on every page
I have been building a greenfield application. It is three layer (data-access, domain-models, presentation) with the presentation layer being VMVC. This is the cleanest application I've ever built by ...
3
votes
3answers
81 views
Why do we separate Data Retrieval from View?
I am seeking a good argument for:
Why is it NOT a good idea to embed data retrieval code in my view?
Example
<tr>
<td>Product</td>
<td><select name="product">
...
-2
votes
2answers
128 views
Angular JS vs Modern MVC frameworks
I might be wrong for some things here, but here is what I recently though about.
Modern frameworks MVC such as ASP.NET MVC 5, CakePHP, Java Spring etc. has their logic clearly separated into Models ...
7
votes
4answers
192 views
Encapsulation for complex queries
I tried asking this question first on StakOverflow in a more concrete manner, but after being pointed here I realized I should rephrase it in more general terms; however, you can still review the ...
2
votes
3answers
113 views
Is Model a better place to set HTTP status code?
In MVC usually the controller sets whatever needs to be sent back to the client/View, including HTTP status code, e.g.:
class Controller {
public function get(Request req, Response resp) {
...
2
votes
2answers
402 views
What did the reviewer refer to in this code review?
I sent the code for a job application and got the following review:
Regarding the Project Structure: Physical separation is absent.
Logical separation is present but not up to best practices. Things
...
3
votes
1answer
46 views
Logic and Values in View or Controller
I have an application built using an MVC framework (for argument's sake, PHP/Yii2) and have a question regarding where to carry out logic and generate values which will be injected into, for example, ...
2
votes
2answers
73 views
Where to put User Interface/Domain Model manipulation logic (transferring data from the view to Domain Model)
We are starting on a greenfield project in ASP.NET MVC. I've used the MVC pattern in other stacks (PHP and Ruby) and I keep running into the same problems of where to place business logic, UI logic, ...
1
vote
1answer
93 views
How far do I separate Model code from Controller code when writing MVC?
I have some code where Controller depends on the Model, and in my case Model acts like a Database Access Object.
use FQDN\Model;
class Controller
{
/** @var FQDN\Model */
private $model;
...
5
votes
1answer
101 views
Am I using Zend Form library correctly? (I am effectively duplicating work in Controller and in View)
Brief Summary
This question is asking for guidance on how to deal with Zend Form library that allows me to specify how to construct each form element (Controller side) and how to render each element ...
6
votes
3answers
332 views
Why does everyone put controllers in one folder and views in another?
I'm getting ready to take the bend out of asp and into an mvc framework, asp.net mvc or nancy. Wherever I go, I see folders for controllers/modules and folders for views. Is this just a pavlovian ...
4
votes
1answer
201 views
Who communicates with the database in MVC/MVP?
I am building a small application and want to save my business objects to a database.
I have my business objects and a model that acts as a container for my business objects and provides methods for ...
3
votes
1answer
69 views
Increase code duplication to simplify business rules in views
I am in the process of writing a Ruby on Rails web application for my university's department.
For some of our resources in the web application, e.g. Project, are complex with their view layer logic:
...
1
vote
0answers
21 views
MVC WebApplication as MQ Subscriber
We have a Web (.Net MVC5) application that we are looking to start offloading some of the heavy processing off the Web Application to a distributed services layer. As part of this process we are ...
0
votes
0answers
66 views
Proper way/place to apply decorator pattern for view layer in mvc
I have an array of model objects containing data some of which is states represented by integers. In the view these states are shown as icons and tooltips. The tooltip is needed only in the view and ...
5
votes
3answers
435 views
“Smart create” method naming
Every class of a model in my application has a create method. The framework gives me the default implementation of create which is “create in the DB”. Sometimes I need to perform some extra actions ...
1
vote
1answer
71 views
How to compute Pricing of Product & Options based on User Option Selection and Pricing per Option
I am building a service for pricing options of a product and for pricing the product itself when product has various options.
Example
User selects some X options out of Y options available, where X ...
1
vote
0answers
40 views
Why separate routes and controllers in MVC backend applications?
I've dabbled in a few MVC frameworks (like Rails and its ilk) and I've noticed that the file that defines restful routes often go separate from controllers which hold the actions executed through ...
0
votes
2answers
186 views
Should a Junior programmer add TDD tests to mvc project
I'm a junior programmer near to my 6 month probation, following my initial career changing 3 month assignment in which I added TDD tests and wondering whether I should add tests to my current work. ...
6
votes
1answer
212 views
MVC - Do I create 'joint' layers when dealing with multiple models?
I'm new to MVC and the different layers architecture and this is what I have currently:
2 models: User, Company
2 service layers: UserService, CompanyService
2 interfaces which abstract the ...
1
vote
1answer
67 views
c# extending a entity framework class
I have a Entity Framework class that was derived from the database layout. I was wondering if there was any problems by extending the class by creating another cs file and using the same public ...
2
votes
2answers
200 views
Do common MVC frameworks violate the LSP and is there a MVC framework which does not?
You who have worked with a framework implementing the MVC architectural pattern most likely know how these frameworks are usually implemented.
They contain a base Controller class, which you extend, ...
0
votes
1answer
177 views
JavaScript & AngularJs Modules Implementation technique and structure
So Im building an app and I'm trying to implement the structure of the app so that its robust and scalable in future.
My app is mostly divided into JavaScript Modules (revealing pattern):
// ...
1
vote
3answers
111 views
Is a TCP client/server a good solution for a system which can be controlled by a GUI running on multiple platforms?
Consider a software which runs on a dedicated system (basically a Linux box), and controls some machinery. The system has all the required hardware interfaces for the task. The software also has a GUI ...
-1
votes
1answer
62 views
(Re)structuring a Qt Project [closed]
A PySide project I've been working on for a while now has started to grow to a point where it's becoming large enough that I've had to step back and re-think the overall design.
I've spent some time ...
0
votes
1answer
63 views
static method, helper function or in the controller, where does this go?
I'm working on a piece of functionality that simply allows a guest user to perform an action a certain number of times before requiring them to login\create account. In this instance, they can vote on ...
-1
votes
2answers
104 views
Creating an ASP.Net MVC web application that can work on different operating systems
I have been developing and deploying many ASP.Net MVC web applications under Windows Server 2008 R2 & Windows Server 2012 R2, and I used IIS 7 & IIS 8. At the same time I know that I can ...
1
vote
2answers
72 views
Should a client check for persisted item existence before modifying it?
I'm developing a MVC Web application with a REST interface.
The REST controller performs actions on persisted items through a service class, which translates exceptions coming from the persistence ...
1
vote
3answers
179 views
What is the correct name for this data object?
I need to understand the proper name for an object that has cropped up in two projects now. Here is the conventional representation for the MVC pattern:
However there is another "Model" that is ...
2
votes
2answers
249 views
is it bad practice that controller call repository instead of service?
is it bad practice that controller call repository instead of service?
to explain more:
I figure out that in good design controllers call service and service use repository.
but sometimes in ...
0
votes
1answer
127 views
If AngularJS already takes care of the MVC, would using ReactJS be needed if it is just the View part?
I heard that AngularJS is becoming quite popular, and at the same time ReactJS is also. But if AngularJS already takes care of MVC with 2 way binding between model and view, would ReactJS actually be ...
-1
votes
1answer
75 views
Find out the user has access to this area - role [closed]
I am in the process of building such that the user access to the different kinds of areas.
I must have sure me that, for example Admin part is for shared Admin.
It is for sure me that I can ...
4
votes
2answers
67 views
Multiple controllers for same resource based on user's Role
I'm having trouble designing this role (or permission) based application, when it comes to figuring out how to handle actions that differ per use role.
For instance, our controller is ...
2
votes
4answers
110 views
Can someone give me a good definition of the term “business logic”? [duplicate]
I kind of get what it means, but not enough to explain it by myself. Is a key concept when talking about the MVC pattern and it's giving me problems to explain that concept too.
1
vote
1answer
22 views
MVC Set or Read View Components
I often see the follwing example when reading about MVC (example is in Java, but question adapts to all OOP languages):
class View{
JTextField tfName;
public String getTfNameText(){
...
-1
votes
1answer
114 views
PHP: where to call helper class in MVC?
I've a helper class in Laravel 5.1 with static methods for calculating week numbers, dates in weeks, etc. (Why static? I need max. 1 instance of this helper class)
I need this logic in my views. I'm ...
2
votes
1answer
160 views
Business logic in the models?
I use the repository pattern for data handling.
In my DAL folder i have IUserRepository, UserRepository and UserContext. Inside the models folder i have a class called User like id, username etc.
I ...
0
votes
1answer
111 views
Is it always better to use __construct() in CodeIgniter's Models and Views, even if it's not needed? [closed]
Sometimes we have Models and Controllers where the function __construct() just doesn't do anything, but is sitting on the top of all the methods in CodeIgniter's models and controllers. A lot of ...
0
votes
1answer
133 views
Webdesign MVC - going in the right direction?
I am trying to learn webdesign using the MVC design pattern. Right now, I am stuck at a point where my code gets more complex, and I am unsure about the structure and where to put which code parts.
I ...
12
votes
1answer
307 views
Can domain models in the database be a sustainable solution?
I just started at a new job as a database developer for a medium-small sized, company based on Microsoft-technology. I noticed early on how much practices deviate from what I've been taught at school ...
1
vote
1answer
31 views
Configuration Files For Web Applications
I am building a MVC application. This app has a core which is where all interfaces, abstract classes and operation logic are situated. It also contains a directory called module, this application is ...
1
vote
2answers
160 views
A proper way to work with MVC
I got into a debate at work today, I hope you can help me to settle it up.
My colleague wants to separate UI, Model, DB, and Network like so:
Create an API level between UI and controller, that ...
2
votes
3answers
238 views
CRUD operations in DDD
I'm designing an application with DDD. I'm moving from flat POCO objects to strong domain models, so my question is:
Would I have to call my basic CRUD operations (located in my repository layer) ...