In MVC architecture (Model-View-Controller), the object responsible for passing and receiving data to and from views, acting as a bridge between the "Model" and the "View".

learn more… | top users | synonyms

3
votes
1answer
44 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 ...
2
votes
0answers
74 views

What can I do better in this ViewModel Creator?

I'm currently creating a ASP.NET MVC page in C#. I want to hide everything regarding the creation of our "models" and "viewmodels". I have seen much of the fancy stuff regarding Dependency ...
0
votes
1answer
29 views

Is it reasonable to have separate controller actions for different user registration paths? Or should I refactor into a fewer number of actions?

I have two registration paths in my app. They are very similar and I am curious if I should simplify 4 associated actions down into two actions that handle the same amount of work. Here are my ...
2
votes
3answers
113 views

Controller with too many dependencies?

The main impetus for this review is to determine if my ASP.NET Web API controller has too many dependencies. I'm of the opinion that 3-4 is okay, but 6 seems like too many. I have many controllers ...
5
votes
2answers
414 views

Using a BaseController in MVC asp.net to reuse the repository

I have a repository class that impliments a repository Interface. In my Controllers I want a way to access the repository without creating constructors each time in the controller. So now all my ...
1
vote
1answer
79 views

Inserting using multiple contexts into LocalDB

I've written this ActionResult to model an Order that goes through. I couldn't think of another way to write this without using context ...
0
votes
2answers
69 views

Codeigniter - in the view or in the controller?

Is this correct? Or am I overloading the responsibilities of the view? ...
3
votes
2answers
411 views

Loading content in page via jQuery

I'm doing a web site in CodeIgniter and I'm loading the content page via jQuery, but I don't know if this is a good practice or not. Could I improve it? jQuery: // Another question here: how can I ...
0
votes
1answer
471 views

PHP MVC: how to do $_POST the right way

I am not sure if I am doing right on how to handle $_POST data in MVC pattern. Below is my attempt. Am I doing it right? // Dummy $_POST data, ...
2
votes
1answer
124 views

is this producer-consumer implementation correct?

I want to ensure that, as much as possible given my skill level, that I'm using relevant patterns correctly and following naming conventions. This is a controller for a poor-mans MUD client using ...
1
vote
2answers
65 views

Can I make this admin method in CakePHP more streamlined?

I have a VenuesController and an EventsController. My venues controller has an admin_add ...
3
votes
0answers
957 views

Review my Generic ASP.net MVC controller that generates many pages?

I recently set out to create an open-source ASP.net MVC web development framework. Specifically, I wanted to automate some of the tasks associated with the creation of data-driven applications. I've ...
1
vote
1answer
67 views

Cleanup controller action

I would like some help to clean up this action, especially from @companies and downward. The comments should be enough to explain :) ...
1
vote
1answer
527 views

Router Class In a Lightweight MVC Boilerplate

I'm trying to come up with a simple router class. I considered using a Request class but that will rather make simple to complex. That is why I did not consider creating one for my framework. ...
1
vote
1answer
44 views

Linq to sql performance

I'm creating a system and I'm using EF with Linq. Model First. So I create my Model (.edmx) and using it, I generated my database and my classes. like the Usuario (user in portugues. going to keep ...
0
votes
2answers
175 views

How could I make my controller a little less hideous?

I have a controller. It functions as follows: A user imports a file and decides whether the files contents contain new entries to be placed into a database, or existing entries entries to be updated. ...
1
vote
1answer
87 views

Duplicate SQL code in controller

How I can rewrite or refactor my controller code? I have the same SQL query (@plan_gp_users) in all defs. ...
0
votes
1answer
167 views

Review: Finished router class for custom mini framework

I have finished my router and would like your thoughts on anything that may be inefficient of could be done better!: class Router { ...
4
votes
1answer
312 views

Code structure for a login modal dialog.

I'm using twitter mobile and I have a login-dialog. login-Dialog is a modal dialog. To call it the user calls loginDialog.show(); I'm not all that comfortable ...
3
votes
3answers
5k views

Search and Filter in MVC3 Razor I am using Linq, is there a better way to do this

Heres my Code and it works fine. I just dont like all the If else, what If I keep adding field to filter, its going to get messy. Ps: I am not using EF and cannot on this. Thanks. CONTROLLER CODE ...
4
votes
1answer
148 views

How to improve this design?

I have some design doubts regarding my controllers and I would like some advice... Everything works. However, I'd like to improve it. Basically I have one controller per screen(Swing). I have created ...
1
vote
2answers
82 views

How can I refactor this oversized Ruby method into smaller bits and have unit tests for them?

This is the existing code. Clearly way too much is going on in this index method and furthermore it's untested (and hard to test in its current form). ...
4
votes
2answers
315 views

PHP MVC controller code needs diet?

This is the dashboard controller code in PHP Symfony 2. It collects some aggregate data and points for charts, but i don't like it very much. Do you think that this code belongs to what a controller ...
1
vote
2answers
151 views

Rails - Loading data in controllers

I am refactoring my controllers, trying to improve the way common data is loaded for the actions. Initially I was using before_filter methods to do this but read ...
8
votes
4answers
3k views

How would you refactor this if statement of a Rails controller?

I first saw this gigantic if and tried to refactor it. Could only end with a endless switch statement. Old code - ...
3
votes
1answer
291 views

Need help with cleaning up this Controller

I've written the following controller and i was looking for some input/advice on how i could go about cleaning this up or rewriting it. I feel like i'm repeating myself a lot or that there might be a ...
2
votes
2answers
621 views

Repetition in Controller code

In the index view a user can search with any combination of one to all of the following parameters: firstname, lastname or ssn. The found search results are displayed in the search results view. In my ...
4
votes
3answers
543 views

Not feeling 100% about my Controller design.

Basically, I'm uploading an excel file and parsing the information then displaying what was parsed in a view. ...