mvc

MVC : calling helper class from Controller instead of via Model - bad practice?

In my Controller I have a line like this: $this->set('uid', Project::returnProjectUid($queryString)); Is this bad practice? Should I ALWAYS pass it to the Model which then calls this helper class or this an acceptable practice? Thanks. ...

codeigniter: where do entities go?

Hey, I was wondering what should I do with my entities? For example, a class named Articles, with a few datamembers (name/title/date) and getters & setters. I could add these to my Articles datamember, but it's better practice to seperate those. So what do you think? Thanks! ...

select statements how to read all from "*"

My statement: string sqlCommandText = "SELECT * FROM ForumThread WHERE"; How can I read * from it? I'm trying like this but its doesnt work: if (reader["*"] != DBNull.Value) { result.TextContent = Convert.ToString(reader["*"]); } ...

What are the best practices to generate "widgetized" content in Rails

On my previous projects built with usage of Zend Framework I extensively used Zend_view's "Action View" helper. It basically allows to initiate a separate cycle of request->dispatch ti action->view_rendering from a view script. Here is the link to an appropriate page of zend framework reference guide (search for "Action View Helper"). ...

how MVC Pattern can be realized in RMI multiuser application ?

Hi! i am trying to create framework/library /API for creating small multiuser games, in which the goal is to achieve 'decoupling' between the server, client and business logic. The server in my case is kind of registering the clients and sent that list to business logic, clients are registering with the server, and the business log...

What's Yii's equivalent for other MVC's Libraries and Helpers?

What's Yii's way of implementing modular functionality to use from Controllers, as there are Helpers and Libraries on Kohana and CodeIgniter? ...

MVC Simple model binding not working

Okay, this has got to be something stupid-as-a-box-of-rocks that I'm doing wrong, but I can't find it. MVC Action: [AcceptVerbs(HttpVerbs.Post)] public virtual ActionResult Create(BatchCreateViewModel createModel) { return RedirectToRoute(MVC.Home.Display()); } BatchCreateViewModel: public class BatchCreateViewModel { bool ...

Should view logic go in a UIView or (when applicable) its UIViewController?

I recently discovered that UIViews should only have UIViewControllers when they fill the entire window (or are managed by another UIViewController such as a UINavigationController or UISplitViewController). This quotation is from the documentation for UIViewController: You should not use view controllers to manage views that fill only ...

Javascript MVC framework

Has anyone used Javascript MVC Framework(s) to develop a production web app? If so what has been your experience? Thanks ...

ASPX editor in ASP.NET MVC warning about a 64-bit assembly

I'm using OpenCV via EMGU CV. Since there are separate assemblies for x64 and x86, I'm compiling my entire website solution for x64. I ran into one problem where the built-in debugging web server freaked out at the x64 binaries, so I started debugging in IIS instead, and that solved most of my problems, except for this one warning that ...

When Rails require mod_rails, what about Django, TurboGears, Symfony, CakePHP? Can they deploy using mod_python and mod_php?

When Rails applications seem hard to deploy (or used to be), what about Django, TurboGears, Symfony, CakePHP -- can they be simply deployed using mod_python or mod_php? Actually, won't it need something like a mod_django so that the code can run in a "Django" environment? (Just like Rails' script/console or Rails 3's rails console) ...

Spring2 web MVC - dynamic views for controller ?

Is there a way in Spring2 to build dynamic views to which a Controller can redirect to? I have a form with a hidden field for an ID. If the form is submited or other exception occurs i want to redirect back to the form (i have set formView). It redirect ok, but when it redirect back to form it is loosing the ID parameter. Is there a way...

ASP MVC DateTime problem model validation problem

I have MS SQL in my local development server and production server. The DateTime format of my local server is "mm/dd/yyyy" but the format in production server is "dd/mm/yyyy". Every thing worked fine in my local server , but when I try to enter a date like "05/31/2010" in my production server, the Model Validation threw an error "The va...

ASP.NET MVC - Where to throw the exceptions?

Best practice to throw the exception if no entry found in the db? // CONTROLLER public ActionResult Edit(int categoryId, int id) { Product target = Products.GetById(id); if (target == null) throw new HttpException(404, "Product not found"); return View("Edit", target); } // REPOSITORY public Product GetById(int id) { r...

How to list the existing action Controller dynamically from within master page?

I want to list all the existing controllers from within master page. For example: In my Controller folder I have: HomeController with actions Index, etc... ProductController with actions Index, Details, etc... ServiceController with actions Index, Edit, etc... SomethingController with actions Index, Update, etc... etc From withi...

Do we need to unit test the GUI when using proper abstraction?

With a good design pattern like MVP, MVC, etc we aim to move all logic out of the GUI. That leaves us with a light weight GUI which ideally just need to "bind" its buttons and fields to properties in some business logic layer. This is a great approach as this layer will be free from GUI stuff, and we can easily write unit tests for it. ...

Who's responsible for the next View?

In an archetypical MVC architectur, where does the logic go, that determines which view to show next? The assumption is some kind of app with several views (windows) that may or may not be visible at different times, depending on user actions. For instance, sometimes the application may need the user to fill out a form with additional ...

How to mock the view in the MVC integration testing using JUnit and EasyMock

Hi, I would like to mock a view implementation of the MVC design pattern. I have implemented the MVP(another MVC variation), and would like to test if the certain methods in the view get called correctly by the controller when a state change happens on the model. The following shows the sequence of method calls on the model, controller ...

PHP MVC + Router and Redirect issue

I have an odd issue that I can not for the life of me figure out. First of all I have developed a PHP MVC framework from scratch. The problem I am having is that I am getting a header redirect execution after an exit() call. Here is a high level view of the routing process: REQUEST_URI is stripped apart and the requested controller, m...

Problem updating through LINQtoSQL in MVC application using StructureMap, Repository Pattern and UoW

I have an ASP MVC application using LINQ to SQL for data access. I am trying to use the Repository and Unit of Work patterns, with a service layer consuming the repositories and unit of work. I am experiencing a problem when attempting to perform updates on a particular repository. My application architecture is as follows: My service ...