What are the main advantages of MVC pattern over the old fashioned 3-layer pattern

The separation of concerns that’s quoted as being an advantage of MVC is actually also an advance of a 3-layer/3-tier system. There too, the business logic is independent and can be used from different presentation tiers. A main difference is that in classic MVC the model can have a reference back to the view. This … Read more

Can angularjs routes have default parameter values?

I recognize that this question is old, but still: Why don’t you just redirect the “empty” URL to one containing the default productId? myModule.config([‘$routeProvider’, function($routeProvider) { $routeProvider. when(‘/products/’, {redirectTo: ‘/products/123’}). when(‘/products/:productId’, {templateUrl: ‘products.html’, controller: ProductsCtrl}) }]);

In the Model-View-Controller principle, what is the Frontend and what is the Backend?

OK.. first the terms: Frontend – are the parts, which are visible to users: HTML, CSS, client-side Javascript. It all is basically “frontend”. In a desktop application frontend would be the GUI. Backend – is the invisible part. In web applications that is your java, ruby, php or any other serverside code. It can be … Read more

How to display a list using ViewBag

In your view, you have to cast it back to the original type. Without the cast, it’s just an object. <td>@((ViewBag.data as ICollection<Person>).First().FirstName)</td> ViewBag is a C# 4 dynamic type. Entities returned from it are also dynamic unless cast. However, extension methods like .First() and all the other Linq ones do not work with dynamics. … Read more

Best practice for saving an entire collection?

Usually REST backends handle single instance creation/update. You would need to change that to accept an array of objects. That said, on the client side, you would need to go directly to the Backbone.sync function Backbone.sync = function(method, model, options) In this case your model should be an array of model. The method should be … Read more

Should authorization be part of the model or controller?

I think this is a grey area. One could argue that the user access is part of the mapping between the HTTP world and the Object-Oriented world. This is what the controller is intended for (hence the heavy use of statics), to transform the incoming request, ready to process the business rules on the domain … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)