Model–View–Controller (MVC) is a design pattern for computer user interfaces that divides an application into three areas of responsibility. It is often applied to websites.
4
votes
2answers
52 views
Would this be considered MVC?
For many days, I've been re-designing my application, applying some custom pattern and making our code looks like a framework. I have something like this for separate the business logic, from views:
...
5
votes
0answers
50 views
Controller for handling user registration
I spent a lot of time doing Go Horse Extreme programming, but now I want to be a better person.
How can I make this method smaller, better, more OOP?
...
0
votes
0answers
12 views
Dynamically add/remove components to/from panel [closed]
I'm in a little planning phase of my project. Here is a picture:
It is a main panel containing several sub panels depending on the selected date in the top center. I want to browse those sub panels ...
2
votes
1answer
56 views
Cleaning User Input
I am not sure if I am approaching this task the correct way. I have a view model with multiple string properties. I pass the model through an interface to a service class that contains a void to ...
3
votes
0answers
26 views
Improving models for a Django quiz
I'm working on a little django quiz taking app. Currently I'm making it's models. So far I've got Quiz, Question, ...
4
votes
0answers
119 views
DRY + principle of least knowledge + MVC in JavaScript
Is there any way of improving this code? (Here's a JSFiddle with an example and comments)
Example: A Hotel greeter can greet guests and accepts tips, but it's impossible to see the total of tips a ...
2
votes
0answers
50 views
Basic and simple view, add, edit and delete functionality
I want to know what needs to improve with my application. Maybe there is a better way instead of what I am using currently.
index.html:
...
1
vote
2answers
84 views
PHP Router for MVC
I recently started developing my first serious project in PHP, a MVC completely build by myself, which is quite a challenge, when being new to OOP.
So the main struggle of the whole project has, and ...
2
votes
0answers
35 views
Proof of concept and learning exercise for the 'ports and adapters' architecture
The script creates a simple app with a GUI containing a input field and a button to select a folder. On startup a default value is set to the input field. If the user types a value or selects a ...
1
vote
0answers
28 views
Am I correctly using MVC in my binding?
I have method in my Controller(GetAllPatients/EnrollmentQueue) which returns correct data(its array of ...
5
votes
1answer
85 views
3
votes
1answer
42 views
Settings class for web app
I needed to write a settings class for my web app; ideally this class should read its settings from a file (and be able to save them back to the file), and have only 1 instance per application - all ...
1
vote
0answers
39 views
Writing an MVC project for the first time - how close am I?
I've recently started programming (learning Ruby) and wrote a small game. Now I've started reading about MVC and am trying to refracture my code to follow that architecture. The only classes with big ...
7
votes
0answers
68 views
PHP-framework with MVC architecture and Active Record pattern for the DB management
I tried to create the PHP-framework, with no experience in the task like this:
Folders:
www dir: protected/, index.php, .htaccess
protected dir: controllers/, core/, models/, views/, inip.php, ...
7
votes
1answer
93 views
Fluent Nhibernate, is the mapping correct?
I'm very new to NHibernate and DB. I have three tables which are connected with many to many relationship.
Here are the tables creation Script:
...
8
votes
2answers
460 views
7
votes
1answer
144 views
MV* Pattern for a board game
I have made a small game in Javascript, while simultaneously learn about the ever so popular model view controller. The game is this, there are 3 players(green, purple, yellow) and they have to try ...
0
votes
1answer
68 views
How to write this code more efficient and simplify creation of dependency objects?
How can I write my code more efficient (not repeating same code)?
And is there a solution that simplifies the way of having to create a lot of dependency objects over and over again whenever I ...
2
votes
1answer
52 views
Member restricted game with API
My website is poorly coded.
The structure is pretty simple:
A RewriteRule redirects /.... to /index.php?page=$1
mypages/page.php contains the page content and actions (model controller and view ...
1
vote
1answer
52 views
How to re-factor dynamic menu code to OOP in a MVC framework?
I have a MVC framework, and I am struggling with the following dynamic menu code.
A menu is pretty much HTML, so technically it should reside in the View, but the dynamic part is driven by PHP and a ...
2
votes
1answer
27 views
.ASP controller code
Here is my controller code. I try to create application with MVC N-layer pattern. I asked my buddy for a shot review, and he said, "You should separate logic from controller".
But my controller only ...
3
votes
1answer
87 views
MVC architecture in PHP
I have developed a few web applications according to my own coding style similar to MVC architecture. I'm a self learner. But there is no controller class or model class. In my way, I don't split the ...
2
votes
2answers
100 views
Is this how an MVC controller supposed to be?
This is the controller I created for my MVC framework, and I think I finally got it right.
Anything I can do to make the code more efficient?
Is this how a MVC controller is supposed to look like?
...
2
votes
1answer
32 views
View Model Filling Fields
I'm currently getting into MVC, and I'm working on a simple CRUD application but to make best use of relational database layout I need to use ViewModels so things look prettier on the UI.
So I have a ...
4
votes
2answers
121 views
ASP.NET MVC architecture questions
I haven't done much .NET development in several years. Now I'm enjoying some of the new stuff with modern .NET. I just want to make sure I'm using things correctly. I'm a solo developer with no one ...
1
vote
1answer
87 views
MVC Layout - Which way to add listeners is better?
So I'm doing a basic MVC layout for a pretty basic game that I am making. The game requires the user to move up/down/left/right via buttons on the GUI. Since I'm using an MVC layout and my buttons are ...
2
votes
3answers
92 views
2
votes
1answer
77 views
Is my Controller class functionality correct?
I'm building my own micro MVC framework with only the absolute core functionality.
How my controller works is that my router will call the controller depending on the request method (GET or POST). ...
2
votes
1answer
48 views
What is an proper way of routing to the right controller in MVC patterns?
I always been curious on how to build great application with proper routing to my controllers, but after seeing some sources of applications like Xenforo, Joomla, it seems completely different, and ...
1
vote
0answers
57 views
Using MVC design pattern to create server [closed]
I would like to to create a server application that listens to a remote client via TCPlistener and output the message to a form.
What I've done so far is :
1) in the ...
2
votes
1answer
143 views
Router for MVC framework: Is it OO and good to go?
Am I utilizing dependency injection correctly?
Any parts of my class that I should decouple?
Anything I could improve in my code when it comes to OO PHP (and MVC)?
The class routes URLs based on ...
0
votes
1answer
99 views
Is my first MVC architecture set up to standards?
I just started learning about the MVC architecture. And I started to create my own MVC framework to how I like it the most.
Here I've got the index.php, indexcontroller.php and view.php. I'm not too ...
3
votes
2answers
87 views
Handling page requests in MVC
Is this an efficient way to handle page requests in MVC?
index.php:
require 'Classes/Autoloader.php';
Autoloader::start();
Session::start();
new Bootstrap();
...
10
votes
1answer
157 views
Markup calculator application using MVC
I want to make sure that the code is correct in terms of its design, code correctness, best practices & Junit testing.
The complete description is given below:
Functioning of the app quickly ...
5
votes
2answers
107 views
A simple web-app code - user registration. Is the layering ok?
So knowing the little pieces is something different and putting them together is something different.
Here is the code where I try to follow good oop practices and 3 - layered structure.
Any ...
3
votes
1answer
137 views
Is this right structure for MVC / MVP application?
I have written a code for an application/website that I wanted to be structured similarly to MVC design pattern (but I think it's rather MVP based on comparison I read). This functions as a kind of ...
10
votes
3answers
243 views
Listener/Observer Model in PHP
I've taken a look at the SPL Listener/Observer model but found that it doesn't work when using static methods. So I wrote my own but it's very simply. Can anyone suggest ways to make it more like the ...
1
vote
0answers
42 views
Modular dynamic based routing with wildcards
I've created this router for my framework and wanted to get some feedback on if it's the most efficient way to search the routes.
The main router
...
3
votes
1answer
90 views
Session state wrapper, extending an existing application
I'm adding additional functionality to an existing MVC .net application, and to help prevent or at least reduce repeated reads to the dB I'm dumping a few custom entities in session. I'm limiting what ...
3
votes
1answer
160 views
Java MVC pattern
I recently posted a question about modeling a system that contains elements that can perform actions (here). The model runs in cycles and parts perform their action every cycle. The model should have ...
4
votes
1answer
90 views
Avoiding redundant code in MVC view page
Based on the true condition, I am making some operations. But I want to simplify the below HTML code in a better way.
...
3
votes
1answer
49 views
Is it a classical MVC (Xerox Parc) implementation?
I've been trying to understand the original MVC implementation (the Xerox Parc's one). I'm sure it has flaws, but it's a simple code to practice/learn the original MVC.
Working example
View ...
3
votes
1answer
131 views
Simple application to experience encapsulation
Looking at the code, is this a proper example of encapsulation?
additionalComputer.php (class)
...
8
votes
1answer
843 views
Intranet PHP application
I'm more of an IT guy (no CS course) with a strong and passionate relationship with Unix and I love KISS.
I'm writing an application to help my coworkers with their daily tasks. Every now and then I ...
5
votes
2answers
88 views
Is it advisable to integrate SQL statements in the JSP pages that are not displayed to the user but handled at the back?
I have a signup form in which the user has to enter the email address and after some quick asynchronous processing at the backend I have to tell the user that whether the email address is already ...
2
votes
1answer
199 views
Where to put common method used in controllers that calls service layer?
I have an asp.net mvc5 web application using the repository pattern, and I have several controllers that need to call my _loggingService (queries audit logs) to get the last updated information for ...
1
vote
1answer
50 views
Is this a model? What is controlling it (controller?) and how does the data get to the view?
My goal is to instantiate a class based on the request and call a method on it based on the request verb. The classes I'm referring to will have methods such as ...
6
votes
4answers
980 views
Making a word processor
The Word Processor I had in mind would be similar to Microsoft's word and OpenOffice. I am trying to keep my logic separated from the User Interface and that separated from the controller, basically ...
2
votes
1answer
99 views
Is the “vanilla” implementation of TodoMVC really an MVC app? [closed]
As a learning process, I am trying to see how one best applies MVC in JavaScript without the use of a framework. As part of this process, I have been looking into TodoMVC, as it has a bunch of ...
0
votes
1answer
75 views
CodeIgniter maintain data through Controllers
I have a main menu in my application, it loads depending on the role of the user that I validate from a table in my data base, but I have to recreate this menu everytime I call a new controller, here ...