The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
69 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. class ...
1
vote
1answer
36 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
158 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. ...
0
votes
1answer
94 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 { public $start_page = 'Dashboard' ; // Change to your home/default ...
4
votes
1answer
193 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 with the coding style I've adopted ...
1
vote
2answers
2k 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
140 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
67 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). def index # @s = "" # @now=DateTime.now ...
4
votes
2answers
265 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
105 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 that helper methods were preferred. ...
8
votes
5answers
2k 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 - # It is a Cause if @causality == "C" @relationship.cause_id = @issueid ...
3
votes
1answer
261 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
571 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 ...
3
votes
3answers
500 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. using System.Data; using System.Data.OleDb; using System.Web; using System.Web.Mvc; using ...