9
votes
Accepted
Simple dice game - JavaScript MVC implementation
MVC thing is hard to be taken right. And yet it is the most popular (my guess) approach in the modern web development.
There are different ways to say what MVC means in particular application. I ...
8
votes
Accepted
Winform, with a workaround to avoid dependencies
If you start thinking with code, you will almost always end up doing bad things. Why? Because it is not natural. OK, no more preaching and let's get to work.
Review of Your Code
I apologize for ...
7
votes
Accepted
Chess application with GUI and AI in Java
On first glance, I wouldn't call things just View, Controller, and Observable, even if they ...
7
votes
Employee Model definition without an ORM
I cannot use an ORM because I'm required to use Stored Procedures
Exchanging one for the other (and back again if you like) should not impact the Model design. So the right question is "... ...
6
votes
ADO.NET database access layer
I suggest using a light-weight ORM called Dapper.
Hides all the dirty work by providing extension methods over ADO.NET.
Take a look at the examples here:
http://dapper-tutorial.net/execute
6
votes
Baseball player statistics controller
Bearing in mind that you claim that you do not to maintain this code anymore1, there are a few suggestions I would have about this code:
define functions and accept parameters- that should allow the ...
6
votes
Accepted
Upload and database insert php function
There are only two hard things in Computer Science: cache invalidation and naming things.
-- Phil Karlton
For the life of me I wouldn't think of the ...
6
votes
Accepted
PHP OOP MVC structure
You have a lot of problems in your code, so let's break them down.
First, you have a database class that is useless. Add all of your database access config (user, password, host, etc) in ...
5
votes
"War" game app with the MVC model
There are definitely many ways to use MVC pattern. But I think there are some misunderstanding in the pattern's motivations given the implementation. Let me see if I can explain it by defining the ...
5
votes
Simple Python calculator applying MVC
Don't import tkinter twice.
You're importing tkinter twice:
import tkinter as tk
from tkinter import *
Just import it once, and prefix everything with ...
5
votes
Accepted
Employee Model definition without an ORM
Naming: variables, methods
Many popular style guides (e.g. esLint, Google JS, AirBnB, etc.) recommend camelCase for method names - use ...
5
votes
Show a list of downloads
I am going break this into three parts:
Your question about the observer.
Some big picture questions about the broader design.
And a ton of tactical observations regarding the code in the question.
...
5
votes
PathFinding.java: The grid view and model
Model
The main issue with this design is that the model doesn't get mutated through functions defined on it. You can get a cell and change it's contents, but the object instance that represents the ...
4
votes
mvc example: form post
Object Oriented Programming Improvements
The first thing you can do to improve code like this is to use dependency injection, instead of instantiating objects with ...
4
votes
Java Tic-Tac-Toe game (implemented through MVC)
This is my understanding of MVC.
The Model should handle all the logic and it knows the state of the board, such as where the pieces are, and the state for a Win.
The view only displays things like ...
4
votes
Accepted
Snake Game in JavaFX
It looks good to me. I only have minor reviews.
All constants should be declared in a final variable.
...
4
votes
Accepted
Getting statistics in rest api endpoint
Not using return values of TryParse
The method receives several parameters as string,
and parses them to other types such as <...
4
votes
Accepted
Business logic inside MVC Cart Controller method
I think there is more to discuss here then business logic inside your controller. I'm going to generally keep it to a high level of discussion, but feel free to comment and ask for specifics. I'm ...
4
votes
Accepted
HttpClient wrapper for simple calls with optional cert
As is this does not work because multiple requests will concurrently operate on the same variables (instance variables and HttpClient internal state as it is being configured).
This is fairly easy to ...
4
votes
Accepted
Laravel UserController Design
First of all do not use Laravel 5.4 even if you've written some* code already, use latest 5.7, and try to always update.
*: You really need to rewrite the application if you have code like you ...
4
votes
Simple dice game - JavaScript MVC implementation
MVC architecture
Obviously it can be difficult to break up the code in JavaScript to MVC components. Typically an instance of the model would hold information about each model item- in this case, a ...
4
votes
Simple dice game - JavaScript MVC implementation
I'd appreciate any helpful review on my code in any area possible.
Here is, in Javascript, MVC stripped down to its essence
MVC parts are intended to be coherent, complete, objects necessarily ...
4
votes
Accepted
Convert IEnumerable<Reads> to CSV
I modified the formatting part for better readability and maintainability, at the cost of lower performance:
...
4
votes
Accepted
Custom MVC framework
Ill just jump right in;
Composer To The Rescue
So you have attempted autoloading, thats great! But by modern standards you should be using composer to;
Manage your dependecies
Manage autoloading ...
4
votes
Filtering data from MYSQL database based on parameters passed with POST request
The entire long conditional is definitely worth to be decomposed and consolidated.
The main mechanics of optimization is based on 3 aspects:
determining a common logic/behavior that needs to be ...
3
votes
Accepted
Notifying view controller of changes to any of five types of models
The type annotation in
...
3
votes
ADO.NET database access layer
1. Alternatives
Just as the other answer suggests, you should be looking into existing framework. There's no use reinventing the wheel unless you're specifically trying to improve it (which is not ...
3
votes
Accepted
Report Page on Volunteer Signup Website
Looking at your sql's you seem to be repeating the same queries in a loop.
I will pick out one simple one for example, it doesn't take long to run on its own, but if you add them all up, the amount of ...
3
votes
Vanilla JavaScript ToDo List implementation
Overall the design of the code looks fine. Bearing in mind that this code was posted ~3 years ago and you likely have learned quite a bit since then, I have some comments about both the UI and the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
mvc × 532php × 203
c# × 107
java × 96
object-oriented × 87
url-routing × 43
javascript × 39
design-patterns × 38
swing × 37
controller × 37
beginner × 30
asp.net × 23
codeigniter × 20
python × 18
asp.net-mvc × 18
game × 17
ruby × 16
ios × 16
html × 15
c++ × 14
performance × 14
ruby-on-rails × 14
laravel × 14
swift × 13
entity-framework × 13