14
votes
Markup calculator application using MVC
I scanned through your code and also stepped through it with a debugger, line-by-line. The more I looked, the more things I found that I wanted to point out.
Let's start by looking at some ...
14
votes
Simple Java MIDI player followup
Well, your post is over a year old, but hopefully this can still be of some use to you!
Javadoc
No need to say the method name again - the method name is automatically part of the Javadoc.
What are ...
13
votes
Accepted
Order a delicious pie here
First of all I'd like to congratulate you on the HTML part, that one looks clean and takes almost all best practices into consideration. I say 'almost' since ... yeah well ... these days people argue ...
13
votes
Accepted
Currency converter using MVC pattern in C++ & QT
The typical MVC pattern has a data flow like this:
...
12
votes
Accepted
C# Rental Program
Disclaimer: if this answer feels like it gets less patient and more "to-the-point" as it goes on, I'm really tired as I am / was writing this and I can't English / logic right now. I promise I mean ...
11
votes
Accepted
MVC controller code
I'm not very familiar with JSP and EL (which isn't very good considering I have an exam on it in a few days), but in general Java terms you can simplify it a lot by moving the separate lists to a <...
11
votes
Comparison of PHP/Yii controllers
In addition to the removed duplicated code, the second version has other improvements too.
Instead of deeply nested if ($isOk) { ... } blocks, it has flattened the ...
10
votes
Accepted
Medical diagnosis selector
Layout
Don't hard-code dimensions and positions. On a Mac, everything looks wrong. (I don't have your images, so I'm going to ignore them for the rest of this review.)
Furthermore, the user of the ...
10
votes
Accepted
PHP Login System with persistent login
Ok, moving down the list...
I would separate the content of the includes folder into 2 semantically named folders: includes and ...
9
votes
Accepted
Rails controller method that conditionally filters results
Creating a model just to check the parameters is overkill and not idiomatic in Rails. If you need some extra logic, use the existing model. In this case, I'd make ...
9
votes
Accepted
Solving quadratic equation using quadratic formula
Naming:
Names like c, r or s don't mean anything, not to you, not to others. Use meaningful ...
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
Listener/Observer Model in PHP
Because it's a framework static methods are used as my preferred method to access a class from multiple classes without having to worry about creating variables of instances that I either have to ...
8
votes
Accepted
PHP Router for MVC
Unfortunately, this is a very large question to ask. So there will be gaps in my answer but i will answer it best i can using code where possible.
You do not want to couple your router with the ...
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
Laravel model and controller interaction
PHP is not my area of expertise, so just some generic notes:
4 is a magic number here:
$post = $this->paginate(4);
Why is ...
7
votes
Accepted
Making this site navigation less verbose
First, a few points on case statements. The last three cases all do the same thing. To reduce duplication, you can allow cases to fall through:
...
7
votes
Accepted
Proper way of using the MVC concept - update
I'll skip MVC for now, as I see a whole review for formatting and the such. Perhaps someone else could break down the pattern for you. Right now, let's focus on each individual class.
Model
...
7
votes
Accepted
ASP controller for tracking equipment
Index
It would appear you primarily do three things here. Sort, Filter, and Page. There's not much to say about your paging, but the sorting and filtering logic clutter the action. Try creating an ...
7
votes
Accepted
Civilization Wars Game
MVC
The MVC pattern is described like this: The controller knows the model and the view. The view knows the model. About how components communication with each other: I've seen different opinions on ...
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
Is this a good controller?
No
I'm not sure why this question is tagged CakePHP but since it is: This is not CakePHP code =).
Some specific points to elaborate:
session_start, $_SESSION
This should not be in any CakePHP ...
6
votes
6
votes
Basic XML template
I'm not that familiar with Play, but overall I can't say that there's anything here I actively dislike. The purpose, layout, variable names and all are quite reasonable and easy to follow. Over all, I ...
6
votes
Listener/Observer Model in PHP
I see several problems here:
It's hard to understand your code because you have not documented any of the methods and their arguments. I have trouble understanding what's the purpose of ...
6
votes
Accepted
Nested LINQ Nightmare, calculating %completed
Break it down into more methods. StudentTracks has multiple responsibilities, you could extract a private method whose job would be to ...
6
votes
Accepted
A hotel greeter named Alfred
From the comments, I guess you would like a theoretical review ;)
This:
...
6
votes
Accepted
Adding friends to address book app
Is it ok that I am setting the properties of the HALContact instance in my view controller?
In general, yes. In specific, however, I really don't like the way ...
6
votes
Accepted
Template engine
There are at least two places in your code where it looks like you wanted to use an object's attributes, but you say $attribute rather than ...
6
votes
Accepted
Retrieving values from UITableViewCell
Let's look at tableView:cellForRowAtIndexPath:. This needs to be abstracted quite a bit more.
First of all, CustomTableViewCell ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
mvc × 551php × 214
c# × 109
java × 94
object-oriented × 93
javascript × 44
url-routing × 43
design-patterns × 39
swing × 37
controller × 37
beginner × 29
asp.net × 24
codeigniter × 21
asp.net-mvc × 18
python × 17
ruby × 17
c++ × 16
game × 15
html × 15
ruby-on-rails × 15
laravel × 15
performance × 14
ios × 14
swift × 13
entity-framework × 13