MVC (Model-View-Controller) is a software architecture pattern that enforces separation of concerns.
-3
votes
0answers
30 views
What should I know to create applications in Phoenix Webframework? [on hold]
I am a beginner in creating web applications. Till this date I have only knowledge of creating applications that run on a command-line or terminal. I would like to advance myself to the next level. I ...
0
votes
2answers
158 views
What did the reviewer refer to in this code review? [on hold]
Please bare with me on this case, I have experience has a developer but I'm new to swift programming, recently I applied to a Job that requires to solve a code challenge. Since there was only a ...
3
votes
1answer
40 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
62 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
85 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
82 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 ...
-3
votes
0answers
43 views
View being rendered twice [migrated]
I'm making a small mvc based website and ive run into a small issue.
I have a form that as a dropdown which should be populated with values from the database.
My model code is:
<?php
...
6
votes
3answers
290 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
181 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 ...
2
votes
0answers
37 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
20 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
61 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
420 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
65 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
45 views
Is this a good use of routes in MVC?
In the time I've spent working with MVC (ASP.NET MVC to be specific) I've found very few situations where I've needed to use custom routing. In my most recent project I came across such a situation. I ...
1
vote
0answers
37 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
174 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
208 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
62 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
136 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
108 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
57 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
62 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
81 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
70 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
178 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
194 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
109 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
62 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
65 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
108 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
108 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
156 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
87 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
130 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
306 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
159 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
212 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) ...
0
votes
1answer
37 views
Confusion over organization of services
I have the following services:
UserServices This has various methods: fetch_by_id(), create() etc.
SessionServices Session handling: create(), destroy(), various getters.
AnswerServices An answer ...
2
votes
1answer
39 views
In MVC framework, where do we define how data are displayed?
I think that the controller should bring the data to view from model. However, is it controller's duty to tell how view should display the data, or the view should know how the data should be ...
4
votes
2answers
374 views
What is NOT MVC? (in a web app)
It is easy to find many descriptions of what MVC is - for instance here, here or in this video.
I'm curious, what is NOT MVC?
or more precisely - In a MVC-using app, what is everything else apart ...
1
vote
1answer
69 views
Where to put common business logic in DDD with MVC
Providing I have the following scenario: I have a Web application where users can deposit money to their accounts (wire transfer). When a user deposits money to their account, they should click the ...
1
vote
1answer
106 views
The Model or the Controller write data on the view in MVC and what is the use of the Model if we have data in Store?
I've read several articles, watched videos and read questions on here, but the more I read and learn about MVC - including MVCS or MVP in addition.. to make it even worse - the broader the pattern ...
0
votes
0answers
28 views
What happens to super handler with instance variables
What will happen if I extend a class A to a controller B, when A has instance variables (private, protected)?
I have a main controller MY_Controller(handler) which has several methods: can_modify ...
2
votes
1answer
269 views
Model-View-Controller design question (One vs. multiple models for multiple view+controller)
I have an issue with shared code in a MVC application. Application controllers/views ABC are different classes but use a common framework. It is a single class reused multiple times.
Let me introduce ...
0
votes
0answers
35 views
MVC single view file with multiple uses depending on passed in value
I'm using Laravel with Blade to build a simple maintenance application for my work. One of the functions of the application is to display simple statistics for a piece of machinery. To keep things ...
2
votes
2answers
190 views
What is the role of the public folder in MVC web applications? [closed]
Must all the controllers, models and views be placed in the private folders? If so, what are the roles of the public folder? What are the correct terminologies for such roles in computer science? How ...